AttributeError: 'str' 对象没有属性 'decode' [英] AttributeError: 'str' object has no attribute 'decode'

查看:93
本文介绍了AttributeError: 'str' 对象没有属性 'decode'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我收到此错误:

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 操作系统.

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

更新

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

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

推荐答案

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

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 .

您应该改为尝试使用 pyzmq(甚至 pyzmq 的 pypi 页面也指出了这一点-静止的) .

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

这篇关于AttributeError: 'str' 对象没有属性 'decode'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆