【发布时间】:2021-05-09 08:28:42
【问题描述】:
无法安装某些扩展,例如 pylint 或 rope,总是以
AttributeError: 'HTMLParser' object has no attribute 'unescape'
平台上下文:
$ 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
在使用 Visual Studio 'popUp' 提示选项安装时,即pylint,在终端启动的命令中说:
$ /home/harry/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py pip install -U pylint --user
开始良好,但以异常终止(“无属性”):
harry@harry-ThinkPad-X220:~/.../MICROSERVICES$ /usr/bin/python /home/harry/.vscoy pip install -U pylint --user-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py
使用缓存收集 pylint
https://files.pythonhosted.org/packages/fb/13/519c1264a134beab2be4bac8dd3e64948980a5ca7833b31cf0255b21f20a/pylint-2.6.0-py3-none-any.whl收集 toml>=0.7.1(来自 pylint)使用缓存 https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl 收集 astroid=2.4.0 (来自 pylint) 使用缓存 https://files.pythonhosted.org/packages/24/a8/5133f51967fb21e46ee50831c3f5dda49e976b7f915408d670b1603d41d6/astroid-2.4.2-py3-none-any.whl 收集 isort=4.2.5(来自 pylint) 使用缓存 https://files.pythonhosted.org/packages/cc/89/6888f573886e9dc0906ec98f1b15888de20919a142c355d7f57ebd977d36/isort-5.7.0-py3-none-any.whl 收集 mccabe=0.6 (来自 pylint) 使用缓存 https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl 收集六~=1.12 (from astroid=2.4.0->pylint) 使用 缓存的 https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl 收集 wrapt~=1.11 (来自 astroid=2.4.0->pylint) 使用 缓存的 https://files.pythonhosted.org/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz 例外:回溯(最近一次通话最后一次):文件 “/usr/lib/python3/dist-packages/pip/basecommand.py”,第 215 行,在 main status = self.run(options, args) 文件“/usr/lib/python3/dist-packages/pip/commands/install.py”,第 353 行,在 跑步 wb.build(autobuilding=True) 文件“/usr/lib/python3/dist-packages/pip/wheel.py”,第 749 行,在构建中 self.requirement_set.prepare_files(self.finder) 文件“/usr/lib/python3/dist-packages/pip/req/req_set.py”,第 376 行,在 准备文件 found_reqs.extend(self._prepare_file(文件“/usr/lib/python3/dist-packages/pip/req/req_set.py”,第 634 行,在 _prepare_file abstract_dist.prep_for_dist() 文件“/usr/lib/python3/dist-packages/pip/req/req_set.py”,第 129 行,在 prep_for_dist self.req_to_install.run_egg_info() 文件“/usr/lib/python3/dist-packages/pip/req/req_install.py”,第 412 行,在 run_egg_info self.setup_py,self.name,文件“/usr/lib/python3/dist-packages/pip/req/req_install.py”,第 387 行,在 setup_py import setuptools # noqa File "", line 1007, in _find_and_load File "", 第 986 行,在 _find_and_load_unlocked 文件中“”,第 664 行,在 _load_unlocked 文件中“”,第 627 行,在 _load_backward_compatible 文件中 "",第 259 行,在 load_module 文件中 "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/init.py", 第 14 行,在 from setuptools.dist import Distribution, Feature File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "",第 664 行,在 _load_unlocked 文件中 “”,第 627 行,在 _load_backward_compatible 文件“”,第 259 行,在 load_module 文件中 "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/dist.py", 第 24 行,在 from setuptools.depends import Require File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "",第 664 行,在 _load_unlocked 文件中 “”,第 627 行,在 _load_backward_compatible 文件“”,第 259 行,在 load_module 文件中 “/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/depends.py”,第 7 行,在 from .py33compat import Bytecode File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "",第 664 行,在 _load_unlocked 文件中 “”,第 627 行,在 _load_backward_compatible 文件“”,第 259 行,在 load_module 文件中 “/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/py33compat.py”, 第 54 行,在 unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape) AttributeError: 'HTMLParser' 对象 没有属性'unescape'
【问题讨论】:
标签: visual-studio escaping extension-methods pylint html-parser