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)
Edit 2 : I just came across a new case. On certain versions of PyCharm, there is only the Windows terminal, so you have to activate your virtual environment manually.
To do this, type .\<project path>\venv\Scripts\activate
You will have (venv) and everything will work again.
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 ;}
Answer from Lexa on Stack OverflowDifferent 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)
Edit 2 : I just came across a new case. On certain versions of PyCharm, there is only the Windows terminal, so you have to activate your virtual environment manually.
To do this, type .\<project path>\venv\Scripts\activate
You will have (venv) and everything will work again.
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 ;}
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

I was following a youtube demo in which someone did a pip install in a google collab.
The pip install was: ! pip install git+https://github.com/openai/whisper.git
! pip install jiwer
It gave me an error in Pycharm.
So, I just got into python (actually, computers in general) and am a complete computer noob. I was messing around in the IDLE that comes with Python. I pip installed pygame from the command prompt, and checked site-packages to make sure I had it. I imported it into the IDLE, and everything worked fine. I then downloaded pycharm and tried to import pygame from there, but I got an error saying that their were no modules named 'pygame'. I know you can install packages inside pycharm, but then those packages can't be opened inside the IDLE. Does anyone know how I can make PyCharm import packages from ones that I pip installed? I am running Python 3.6 on a Windows 10 if that helps.
Make sure you project in Pycharm is configured to use the same python interpreter you have installed in your PATH
PyCharm lets you use virutal enviorments (clean python installations) for each project, and you need to specify which interpreter you want for each project.
In the settings, uner Project: (project name) ->Project Interpreter. Just find your regular python executable in it's installation folder, usually is listed there. Otherwise, you'll either see another installation somewhere, like on in the venv folder in your project folder. Or in case you have multiple python installations on your computer, those might be listed/used.
I have got a solution, i reffered to https://youtrack.jetbrains.com/issue/PY-20081#u=1468410176856.
Here they have tried to add https://pypi.python.org/pypi as a repository.
To add it as a repository,
1.) Go to Settings
2.) Project interpreter
3.) Click the + sign on top right edge
4.) Go to manage repositories,
5.) Press the + Sign, then add https://pypi.python.org/pypi
6.) Press Ok
Now all the packages should load.
Thanks Hami Torun & Simon, I was able to solve it by luck.
I had the same issue. It happened suddenly, day ago I was able to perform pip or install packages but on the next day error appeared. However this helped (I used version PyCharm Community Edition 2018):
Go to Settings -> Project Interpreter -> click green "+" icon (on right) -> Manage Repositories (on bottom) -> delete https://pypi.python.org/simple -> add https://pypi.python.org/pypi then click Ok. Repo will be back again as /simple, but don't worry, error should disappear and you should be able to install packages again.
sudo apt-get install python3-setuptools should get the work done.
Link : https://packaging.python.org/tutorials/installing-packages/
Since OP is using windows, python -m pip install -U pip setuptools should get the work done.
i think you need to install setuptools
sudo apt-get install python3-setuptools
The problem is that you install the matplotlib globally instead of in your current virtual environment. There are 2 ways to fix this:
- Activate your virtual environment in your command prompt first, then run the
pip installcommand. - Manage your packages via PyCharm package manager. Make sure that you set up the interpreter correctly.
I usually go with option 2 since it's easier that way.
I saw your attached image. I think the matplotlib is getting installed on the system python version but not on the python version installed on the Pycharm.
To install the matplotlib on the pycharm's python version you have to open Pycharm terminal and run the pip install matplotlib