繁体   English   中英

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

[英]AttributeError: 'str' object has no attribute 'decode'

我将使用pip软件包安装程序在我的PC中安装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 OS。

更新资料

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

为什么要使用pyzmq-static 根据此参考 pyzmq-static已过时,最新的软件包已于2012年11月9日上载,也许它不是针对python 3.x开发的。

相反,您应该尝试使用pyzmq (甚至pyzmq-static的pypi页面也指出)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM