Reputation: 47
Inside my pycharm package section pip (v:21.3.1) is showing as installed but when running pip commands it shows following error
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.
Upvotes: 3
Views: 32718
Reputation: 47
Simply add Python pip to the system Path and restart your IDE, In CMD, use
where python
to get installation path of your base Python, then use add it in the system Path variable parameters in System Properties app>Advanced>Environment Variables>[Path>Edit>[add the dir path]] >Save Restart the CMD and IDE/PowerShell_Console
Upvotes: 0
Reputation: 1
This problem can easily be solved by re-running the Python set-up file (python.exe)
Upvotes: 0
Reputation: 71
Different solutions to this problem:
First: you are not on the pycharm terminal but on the power-shell terminal
(if so, use the drop-down menu to the right of the +)
edit: if you opened the file/folder without creating a project, pip won't work in it (using a virtual env anyway)
Second : you have a python3 environment (use pip3 instead)
Last : your path is badly configured (not a big problem, passing by python -m pip ...
it will work (or python3 or other version installed))
Finally, except in very specific cases file->setting->python Interpreter allows you to install anything you want without command line
Hoping to have helped you ;}
Upvotes: 5
Reputation: 81
Solution 1: Install packages within pycharm & run the code within pycharm
Solution 2:
Find python.exe in the install directonary, open cmd in the folder and run following:
python.exe -m pip install ...
Solution 3: activate the venv (you can find instructions on google or use the one from the dude above)
Upvotes: 0
Reputation: 127
My guess is that you are not inside the Pycharm virtual environment.
Try to go to the terminal/command line and go to the project directory, you should look for 'venv' directory. Than activate the virtual enviorment. terminal: source /venv/Scripts/activate (run activate.sh file)
command line call /venv/Scripts/activate (run activate.bat file)
and then you will be able to run pip
Upvotes: 2
Reputation: 57
use !pip
that might help. Else, try to see pip list and uninstall the package and try uninstalling using '!pip', this takes directly outside the main terminal.
Upvotes: 1