This is caused by inconsistent lib paths of pip and python in Debian systems. You only need to copy Alibaba Cloud SDK to the dist-package directory of lib in Ubuntu.
Taking Python 2.7 as an example, after SDK is installed using pip, the SDK will be saved in the following directory if it is a Debian system: /usr/local/lib/python2.7/dist-packages/.
Before copying the SDK, run the following commands under python:
python <-- Enter the python environment
> from distutils.sysconfig import get_python_lib
After finding the lib path, run the following command to copy the SDK:
sudo cp -r /usr/local/lib/python2.7/dist-packages/aliyun* /usr/lib/python2.7/dist-packages/
After the SDK is copied, you can run it.