python - 如何解决 Python Pylint 安装错误
问题描述
我尝试使用以下命令在我的 VS Code 中安装Pylint :
pip install pylint
输出是这样的:
Requirement already satisfied: pylint in c:\users\domin\appdata\roaming\python\python39\site-packages (2.6.0)
Requirement already satisfied: toml>=0.7.1 in c:\users\domin\appdata\roaming\python\python39\site-packages (from pylint) (0.10.1)
Requirement already satisfied: astroid<=2.5,>=2.4.0 in c:\users\domin\appdata\roaming\python\python39\site-packages (from pylint) (2.4.2)
Requirement already satisfied: isort<6,>=4.2.5 in c:\users\domin\appdata\roaming\python\python39\site-packages (from pylint) (5.6.1)
Requirement already satisfied: colorama in c:\users\domin\appdata\roaming\python\python39\site-packages (from pylint) (0.4.3)
Requirement already satisfied: mccabe<0.7,>=0.6 in c:\users\domin\appdata\roaming\python\python39\site-packages (from pylint) (0.6.1)
Requirement already satisfied: six~=1.12 in c:\users\domin\appdata\roaming\python\python39\site-packages (from astroid<=2.5,>=2.4.0->pylint) (1.15.0)
Requirement already satisfied: wrapt~=1.11 in c:\users\domin\appdata\roaming\python\python39\site-packages (from astroid<=2.5,>=2.4.0->pylint) (1.12.1)
Requirement already satisfied: lazy-object-proxy==1.4.* in c:\users\domin\appdata\roaming\python\python39\site-packages (from astroid<=2.5,>=2.4.0->pylint) (1.4.3)
它只返回简单的光标:
PS C:\Users\domin>
每当我尝试使用它时,VS Code 都会返回以下消息:
pylint : The term 'pylint' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pylint .
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (pylint:String) [], CommandNotFo
undException
+ FullyQualifiedErrorId : CommandNotFoundException
我应该怎么办?
解决方案
这个输出告诉你,你已经得到了这个包,它的依赖项安装在 python 3.9 的站点包中。
如果你需要在你的机器上安装特定的 python 版本来安装它,你需要输入以下内容:
/path/to/your/bin/python -m pip install pylint
与 virtualenv 相同。如果要将其安装到 virtualenv python 中:
source mypython/bin/activate
pip install pylint
推荐阅读
- ruby-on-rails - 在我刷新整个页面之前,acts_as_votable ajax 不会更新数据
- neo4j - 使用 neo4j-admin 导入加载后 Neo4j 数据库不可见
- reactjs - 在状态中设置一个空数组
- aws-codepipeline - AWS CodePipeline 中配置文件的转换/替换
- laravel - Laravel 为前缀操作创建链接
- javascript - javascript什么时候抛出引用错误?
- java - Spring Boot Data JPA 无法连接到 VirtualBox Ubuntu MySQL 服务器
- python - BS4 Scraping:获取有时会更改位置的跨度文本
- python - 如何从内部函数更改函数范围内的变量
- python - 哪个国家的价格具有空值