由于我的环境安装的是python3.6及pip3.6,与python2.7(系统默认)共存的,基本上来说安装过程还是很简单的,下面记录了一些安装过程中遇到的问题:
pip3.6 install oss2
报错:
Complete output from command python setup.py egg_info:
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-48095srz/cryptography/setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
这里是 setuptools_rust的问题,安装即可
pip3.6 install setuptools_rust
安装seuptools_rust时又遇到下面错误:
FileNotFoundError: [Errno 2] 没有那个文件或目录: '/usr/local/lib/python3.6/site-packages/setuptools-19.6-py3.6.egg'
这是由于setuptools版本太老的缘故,升级即可:
python3.6 -m pip install -U pip setuptools
升级完成后再次执行pip安装oss2命令:
pip3.6 install oss2
此时会报一个警告:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
这是pip的版本的问题,可以不用管他,到这里oss2的安装基本就顺利完成,可以开始使用python oss sdk开发了。