Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

escaping - Visual Studio, install extension pylint failing with: AttributeError: 'HTMLParser' object has no attribute unescape

Not possible to install some Extensions, like pylint or rope, ending always with

AttributeError: 'HTMLParser' object has no attribute 'unescape'

Plattform Context:

$ lsb_release -a

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

$ python --version

Python 3.8.3

$ code #visual studio

1.53.0
8490d3dde47c57ba65ec40dd192d014fd2113496
x64

While using visual studio 'popUp' hint option to install i.e. pylint, in terminal initiated comand says:

$ /home/harry/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py  pip install -U pylint --user

starting well, but terminating with exception ("no attribute"):

harry@harry-ThinkPad-X220:~/.../MICROSERVICES$ /usr/bin/python /home/harry/.vscoy pip install -U pylint --user-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py

Collecting pylint Using cached

 https://files.pythonhosted.org/packages/fb/13/519c1264a134beab2be4bac8dd3e64948980a5ca7833b31cf0255b21f20a/pylint-2.6.0-py3-none-any.whl

Collecting toml>=0.7.1 (from pylint) Using cached https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl Collecting astroid<=2.5,>=2.4.0 (from pylint) Using cached https://files.pythonhosted.org/packages/24/a8/5133f51967fb21e46ee50831c3f5dda49e976b7f915408d670b1603d41d6/astroid-2.4.2-py3-none-any.whl Collecting isort<6,>=4.2.5 (from pylint) Using cached https://files.pythonhosted.org/packages/cc/89/6888f573886e9dc0906ec98f1b15888de20919a142c355d7f57ebd977d36/isort-5.7.0-py3-none-any.whl Collecting mccabe<0.7,>=0.6 (from pylint) Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl Collecting six~=1.12 (from astroid<=2.5,>=2.4.0->pylint) Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl Collecting wrapt~=1.11 (from astroid<=2.5,>=2.4.0->pylint) Using cached https://files.pythonhosted.org/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz Exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run wb.build(autobuilding=True) File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 376, in prepare_files discovered_reqs.extend(self._prepare_file( File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 634, in _prepare_file abstract_dist.prep_for_dist() File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist self.req_to_install.run_egg_info() File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 412, in run_egg_info self.setup_py, self.name, File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 387, in setup_py import setuptools # noqa File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/init.py", line 14, in from setuptools.dist import Distribution, Feature File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/dist.py", line 24, in from setuptools.depends import Require File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/depends.py", line 7, in from .py33compat import Bytecode File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module 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'

question from:https://stackoverflow.com/questions/66055787/visual-studio-install-extension-pylint-failing-with-attributeerror-htmlparse

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

VS was embedded in Python 3.9 and dependencies. After switch to Python 3.8.3, problem is gone, lint installed and working as expected.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...