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 "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\suichu\AppData\Local\Temp\pip-install-ks4zcaeh\qcloud-python-sts_5d9378b728a74916bb25450687600b2e\setup.py", line 5, in <module>
          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

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

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

老师我作业忘带了

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值