Closed raymondzhaoy closed 6 years ago
从qcloud_cos import, 如果有下载v4的 python sdk,请先卸载,v4的也叫qcloud_cos,会冲突。
如果你用 python3 ,需要切换成 pip3 来安装:
pip3 install -U cos-python-sdk-v5 -i https://mirrors.cloud.tencent.com/pypi/simple
还要区分小版本号。比如我用pip install cos-python-sdk-v5试过了不行,换成pip3 install ....还是不行,最后注意到提示是
/var/lang/python310/bin/python3.10 /usr/local/var/functions/ap-shanghai/xxx/xxx/src/import_qcloud_cos.py
Traceback (most recent call last):
File "/usr/local/var/functions/ap-shanghai/xxx/xxx/src/import_qcloud_cos.py", line 1, in <module>
import qcloud_cos_v5
ModuleNotFoundError: No module named 'qcloud_cos_v5'
指向了python10。 用pip310 install cos-pyhon-sdk-v5安装才可以。
按说明安装后提示找不到cos_client模块
安装命令:pip install -U cos-python-sdk-v5
安装完成后显示安装成功,导入时提示找不到对应的模块:
$ python Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information.