AttributeError: 'str' object has no attribute 'decode'

帅比萌擦擦* 提交于 2021-02-08 13:21:48

问题


I am going to install ZeroMQ library in my pc using pip package installer. I use https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/basics.html#installation as my reference. After executing follwing command:

pip install pyzmq-static

I get this error:

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

My python version is 3.5 and I use windows 8.0 OS.

Update

I found that my referenced article has used python 2.X and I am using python 3.5.


回答1:


Why are you using pyzmq-static ? According to this reference pyzmq-static is obsolete, the latest package for it was uploaded on 11-09-2012 , maybe it was not developed for python 3.x .

You should instead try using pyzmq (as even indicated by the pypi page for pyzmq-static) .



来源:https://stackoverflow.com/questions/30936826/attributeerror-str-object-has-no-attribute-decode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!