'Pip' recognized in Command Prompt but not

2019-05-08 05:41发布

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.

2条回答
看我几分像从前
2楼-- · 2019-05-08 06:31

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

查看更多
Rolldiameter
3楼-- · 2019-05-08 06:32

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

Project 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)

查看更多
登录 后发表回答