Tôi sẽ cài đặt thư viện ZeroMQ trong máy tính của tôi bằng cách sử dụng trình cài đặt gói pip. Tôi sử dụng https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/basics.html#installation làm tài liệu tham khảo của mình. Sau khi thực hiện lệnh follwing:AttributeError: đối tượng 'str' không có thuộc tính 'decode'
pip install pyzmq-static
tôi nhận được lỗi này:
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
phiên bản python của tôi là 3,5 và tôi sử dụng windows 8.0 OS.
Cập nhật
tôi thấy rằng bài viết tham chiếu của tôi đã sử dụng python 2.X và tôi đang sử dụng python 3.5.
Bạn đang sử dụng Python 3? Có vẻ 'str.decode' tồn tại trong Python 2, nhưng không có trong Python 3. –
@tobias_k, vâng tôi sử dụng python35. Tôi sẽ cập nhật bài đăng của mình. –
là mô-đun này có sẵn cho phiên bản python 3 – The6thSense