我在 AWS EC2 上设置了一个新的 Debian 10 (Buster) 实例,并且能够安装依赖于 netifaces 的 pip3 软件包,但是当我第二天返回时,该软件包崩溃并报告 netifaces 中的错误。如果我尝试运行 pip3 install netifaces 我会收到相同的错误:
~$ pip3 install netifaces
Collecting netifaces
Using cached https://files.pythonhosted.org/packages/0d/18/fd6e9c71a35b67a73160ec80a49da63d1eed2d2055054cc2995714949132/netifaces-0.10.9.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 35, in <module>
from setuptools.depends import Require
File "/usr/lib/python3/dist-packages/setuptools/depends.py", line 7, in <module>
from .py33compat import Bytecode
File "/usr/lib/python3/dist-packages/setuptools/py33compat.py", line 55, in <module>
unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
AttributeError: 'HTMLParser' object has no attribute 'unescape'
HTMLParser().unescape
在 Python 3.9 中被删除。比较Python 3.8 中的代码 https://github.com/python/cpython/blob/v3.8.0/Lib/html/parser.py#L466 vs Python 3.9 https://github.com/python/cpython/blob/v3.9.0/Lib/html/parser.py.
该错误似乎是一个错误setuptools
。尝试升级setuptools
。或者使用Python 3.8。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)