AttributeError:“str”对象没有属性“decode”

2024-05-04

我将使用 pip 软件包安装程序在我的电脑上安装 ZeroMQ 库。我用https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/basics.html#installation 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操作系统。

Update

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


你为什么使用pyzmq-static?根据这个参考 https://pypi.python.org/pypi/pyzmq-static pyzmq-static已过时,其最新包已于 11-09-2012 上传,可能不是为 python 3.x 开发的。

你应该尝试使用pyzmq https://pypi.python.org/pypi/pyzmq/(甚至如 pyzmq-static 的 pypi 页面所示)。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

AttributeError:“str”对象没有属性“decode” 的相关文章

随机推荐