python3.6 pip安装oss2遇到的问题

本文记录了在Python 3.6环境下安装OSS2 SDK过程中遇到的问题及解决办法,包括解决setuptools_rust缺失、setuptools版本过旧等问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于我的环境安装的是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开发了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值