栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

qcloud-python-sts 下载安装

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

qcloud-python-sts 下载安装

解决腾讯云下载sts/nstall -U ython-sts报错:

应该有人会出现这样的报错:

Collecting qcloud-python-sts
  Using cached qcloud-python-sts-3.1.1.tar.gz (5.9 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "", line 2, in
        File "", line 34, in
        File "C:UserssuichuAppDataLocalTemppip-install-ks4zcaehqcloud-python-sts_5d9378b728a74916bb25450687600b2esetup.py", line 5, in
          long_description = fh.read()
      UnicodeDecodeError: 'gbk' codec can't decode byte 0x8b in position 82: illegal multibyte sequence
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

这里也不看是什么原因了,直接手动去官网下载:qcloud-python-sts · PyPI

下载完成后解压  是这样一个文件:

把它拖到你python包的路径下面

比如我的python安装在了C盘,那路径如下:

在腾讯云的SDK文档中 demo里是直接from sts.sts import Sts

我们只需要把上面说的下载下来的文件名字重命名为sts就好了。

这之后 我们运行代码发现还会报错,经分析是无法导入sts下的sts的sts.py中的Sts类导致的。所以我们点开文件:

双击sts.py 

加上这样一句话就可以了

from sts.sts.sts import Sts

然后就解决了,干净又卫生。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/846299.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号