Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 855
Brendan Avatar asked Jul 21 '18 00:07

Brendan


People also ask

Why pip is not working in Terminal?

This error usually means there's a problem with the Python installation or the system variable PATH is not set up correctly. Try reinstalling Python and all its components to fix the problem. The easiest way is via the Python executable installer.

How do I enable pip in PyCharm?

Open project settings (File > Settings...) (preferences on Mac) Project > Project Interpreter. Press the + button.

Does pip work in PyCharm?

By default, PyCharm uses pip to manage project packages. For Conda environments you can use the conda package manager. In PyCharm, you can preview and manage packages in the Python Packages tool window and in the Python interpreter Settings/Preferences.

How do I run pip in terminal?

Ensure you can run pip from the command lineRun python get-pip.py . 2 This will install or upgrade pip. Additionally, it will install setuptools and wheel if they're not installed already. Be cautious if you're using a Python install that's managed by your operating system or another package manager.


2 Answers

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

like image 185
Brendan Avatar answered Sep 22 '22 17:09

Brendan


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)

like image 39
Ken Colton Avatar answered Sep 20 '22 17:09

Ken Colton