'Pip' recognized in Command Prompt but not in PyCharm terminal

只谈情不闲聊 提交于 2019-12-22 08:51:40

问题


When I try to run pip in the Windows Command Prompt, pip -V works fine, but when I try to run it in PyCharm terminal I get 'pip' is not recognized as an internal or external command, operable program or batch file.

My Path environmental variables are set for:

C:\Users\username\AppData\Local\Programs\Python\Python37\Scripts\
C:\Users\username\AppData\Local\Programs\Python\Python37\
C:\Users\username\AppData\Roaming\Python\Python37\Scripts\
C:\Users\username\AppData\Roaming\Python\Python37\

The main difference I can think of is that the PyCharm terminal and project opens on D:, and my path variables are set to C: but I don't know why that would affect it. I have recently uninstalled and reinstalled both PyCharm and Python (a previous version) if that helps, but I made it a point to not import any settings.

This is a potential duplicate of this question but it's also unresolved.


回答1:


Answer to my own question: when things don't make sense, try turning it off and on again. Problem was fixed with a restart.




回答2:


Check your Preferences -> Project -> Python Interpreter settings:

(sorry for Mac screenshots and paths, but not near my Windows PC atm but should give general idea of a possible problem area and how to correct)



来源:https://stackoverflow.com/questions/51451795/pip-recognized-in-command-prompt-but-not-in-pycharm-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!