gpt4 book ai didi

python - 属性错误 : 'str' object has no attribute 'decode'

转载 作者:行者123 更新时间:2023-12-04 12:19:49 27 4
gpt4 key购买 nike

我将使用 pip 包安装程序在我的电脑中安装 ZeroMQ 库。我用 https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/basics.html#installation作为我的引用。执行以下命令后:

pip install pyzmq-static

我收到此错误:
C:\Users\MyName>pip install pyzmq-static
You are using pip version 7.0.1, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pyzmq-static
Using cached pyzmq-static-2.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "C:\Users\MyName\AppData\Local\Temp\pip-build-m8zyvx48\pyzmq-static\
setup.py", line 6, in <module>
long_description = open(os.path.join(os.path.dirname(__file__), 'README.
rst')
AttributeError: 'str' object has no attribute 'decode'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\MyName\
AppData\Local\Temp\pip-build-m8zyvx48\pyzmq-static

我的 python 版本是 3.5,我使用 Windows 8.0 操作系统。

更新

我发现我引用的文章使用了 python 2.X,而我使用的是 python 3.5。

最佳答案

您为什么使用 pyzmq-static ?根据 this reference pyzmq-static已经过时了,它的最新包是在 11-09-2012 上传的,也许它不是为 python 3.x 开发的。

你应该尝试使用 pyzmq (甚至如 pyzmq-static 的 pypi 页面所示)。

关于python - 属性错误 : 'str' object has no attribute 'decode' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30936826/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com