Why is 'pip3 install netifaces' failing on Debian 10 Buster?

Solution 1:

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

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

Solution 2:

I was facing this issue in PyCharm 2018. Apart from upgrading setuptools as mentioned above, I also had to upgrade to PyCharm 2020.3.4 to solve this issue. Related bug on PyCharm issue tracker: https://youtrack.jetbrains.com/issue/PY-39579

Hope this helps someone avoid spending hours trying to debug this.