本文介绍了为什么在Debian 10 Buster上'pip3 install netifaces'失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS EC2上设置了一个新的Debian 10(Buster)实例,并且能够安装依赖于netifaces的pip3软件包,但是第二天我回到它时,该软件包中断了,报告了netifaces中的错误.如果我尝试运行pip3 install netifaces,则会收到相同的错误:

I setup a new Debian 10 (Buster) instance on AWS EC2, and was able to install a pip3 package that depended on netifaces, but when I came back to it the next day the package is breaking reporting an error in netifaces. If I try to run pip3 install netifaces I get the same error:

~$ 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中的代码 Python 3.9 .

HTMLParser().unescape was removed in Python 3.9. Compare the code in Python 3.8 vs Python 3.9.

该错误似乎是 setuptools 中的错误.尝试升级 setuptools .或使用Python 3.8.

The error seems to be a bug in setuptools. Try to upgrade setuptools. Or use Python 3.8.

这篇关于为什么在Debian 10 Buster上'pip3 install netifaces'失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 14:10