Visual Studio 代码安装 python 扩展 pylint 失败
Visual Studio Code install python extension pylint failed
今天,我使用vscode编辑python代码,vscode提醒安装pylint。所以我安装 python externsion ,同时我在终端安装 oylint 使用 cmd python -m pip install -U pylint --user
。
但是终端上报了
的信息
Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\utils\__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 74, in <module>
__import__('pip._vendor.packaging.requirements')
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\packaging\requirements.py", line 9, in <module>
from pip._vendor.pyparsing import (
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pyparsing.py", line 4720, in <module>
_reBracketExpr = Literal("[") + Optional("^").setResultsName("negate") + Group( OneOrMore( _charRange | _singleChar ) ).setResultsName("body") + "]"
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pyparsing.py", line 1201, in setResultsName
newself = self.copy()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pyparsing.py", line 1160, in copy
cpy = copy.copy( self )
AttributeError: module 'copy' has no attribute 'copy'
目前我找不到处理问题的有效措施,所以我在这里寻求帮助,谢谢!
您的工作区中可能有一个名为 copy
的模块。重命名它,这样它就不会从 Python 的标准库中隐藏内置的 copy
模块,并且应该让 pip 运行 正确。
今天,我使用vscode编辑python代码,vscode提醒安装pylint。所以我安装 python externsion ,同时我在终端安装 oylint 使用 cmd python -m pip install -U pylint --user
。
但是终端上报了
Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\utils\__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 74, in <module>
__import__('pip._vendor.packaging.requirements')
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\packaging\requirements.py", line 9, in <module>
from pip._vendor.pyparsing import (
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pyparsing.py", line 4720, in <module>
_reBracketExpr = Literal("[") + Optional("^").setResultsName("negate") + Group( OneOrMore( _charRange | _singleChar ) ).setResultsName("body") + "]"
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pyparsing.py", line 1201, in setResultsName
newself = self.copy()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\pyparsing.py", line 1160, in copy
cpy = copy.copy( self )
AttributeError: module 'copy' has no attribute 'copy'
目前我找不到处理问题的有效措施,所以我在这里寻求帮助,谢谢!
您的工作区中可能有一个名为 copy
的模块。重命名它,这样它就不会从 Python 的标准库中隐藏内置的 copy
模块,并且应该让 pip 运行 正确。