我刚从 PyCharm 切换到 VSCode,当我尝试 pip install X 时,我收到以下消息:
pip : The term 'pip' 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
+ pip install discord
+ ~~~
+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoun
dException
+ FullyQualifiedErrorId : CommandNotFoundException
我已经更新了 PATH,当我在命令提示符下执行“echo %PATH%”时,我得到与我的 PyCharm PATH 目录完全相同的目录。为什么 VSCode 不工作,而 PyCharm 工作完美?
我在 cmd 上的路径:“C:\Users\USERNAME\AppData\Local\Programs\Python\Python37-32\Scripts”
原文由 yucecoder 发布,翻译遵循 CC BY-SA 4.0 许可协议
尝试使用
python -m pip
而不是pip
。