AttributeError: ‘HTMLParser‘ object has no attribute ‘unescape‘ 2021-08-16

AttributeError: ‘HTMLParser’ object has no attribute ‘unescape’

从python3.6升级到python3.9遇到问题:
AttributeError: ‘HTMLParser’ object has no attribute ‘unescape’
解决方法:
更新pip3 install setuptools
如果还是包相同错误,查看两次报错信息setuptools版本是否相同并没有更新版本如下:
File “/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/py33compat.py”, line 54, in
unescape = getattr(html, ‘unescape’, html_parser.HTMLParser().unescape)
AttributeError: ‘HTMLParser’ object has no attribute ‘unescape’
卸载setuptools并删除setuptools-39.0.1-py2.py3-none-any.whl文件重新安装问题解决。

你可能感兴趣的:(python版本升级问题,笔记,python)