21

I have installed Anaconda 3 and PyCharm Community Edition after that. I am able to chose the interpreter to be a Conda environment. But when I try using certain packages, such as Matplotlib, it throws "Module not found error". When I run pip, it returns saying that matplotlib is available.

pip install matplotlib
Requirement already satisfied: matplotlib in./anaconda3/lib/python3.6/site-packages

Clearly the package is there and for some reason it does not show up.

2
  • Found the solution. Went to Pycharm --> Preferences --> Python Interpreter 1) Removed all interpreters 2) selected "existing interpreter" and pointed to ~/anaconda3/bin/python and all the packages installed with Anaconda3 are loaded. Pheww!!!
    – Ash
    Mar 4, 2018 at 16:50
  • for me deleting all conda envs except the one I wanted stopped pycharm getting confused when I selected the actual conda env I wanted to use...odd! Jun 28, 2022 at 18:07

4 Answers 4

24

Apparently the naming of the selection depends on the operating system, but the Python interpreter can be selected as follows:

  • Menu FilePreferencesProjectPython Interpreter (macOS)
  • Menu FileSettingsProjectPython Interpreter (Windows and Linux)

Using the dropdown, select the right Python interpreter. Depending on your OS and setup, this can be the default interpreter (e.g., ~/anaconda3/bin/python) or the interpreter corresponding to the Conda environment of your choice (e.g., C:\users\username\.conda\envs\projectname\python.exe).

Screenshot of PyCharm Settings

Now all the packages installed with Anaconda should be listed.

Screenshot of PyCharm Preferences listing packages installed

3
  • 1
    Yeah guys, don't create a "New Environment". Anaconda is an "Existing Environment" since it already contains all the packages. You don't want to create a "New Environment" and try to install all those packages yourself...
    – NoName
    Dec 2, 2019 at 0:17
  • I do not see Preferences in Pycharm. Do you mean Settings/Project/Python Interpreter? Nov 26, 2021 at 9:26
  • @Sander Heinsalu That probably depends on your OS. Apparently "Preferences" with MacOS and "Settings" with Windows.
    – marianoju
    Dec 1, 2021 at 12:33
1

With Python 2019.2.3, (CE) there are the following steps on a Windows 10 system:

  1. Go to FileSettings in the menu bar or alternatively press Ctrl + Alt + S

  2. Go to to the entry ProjectProject Interpreter

    Step 1

  3. Select Show All in the dropdown menu:

    Step 2

  4. If your Conda Environment is not listed, press the + button and select Conda Environment on the left:

    Step 3

    Now select the desired environment by opening the dropdown menu Interpreter and click OK. Now your Conda environment should be listed as project interpreter. Click OK to close the window and click Apply in the settings window.

1
  • On Windows 10, Python 3.9, Anaconda3, I see Interpreter: <No interpreter> and clicking on it shows an empty dropdown menu. I have tried creating several new and existing environments but the simple scripts I have do not run. Nov 26, 2021 at 9:29
0

Go to PyCharm → PreferencesPython Interpreter. Select the Use Conda Package Manager symbol (green circle).

After it refreshes, select the Install (^N) symbol. Search for the installed package

0

For me, installing didn't help. It was already there.

pip3 install matplotlib

Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/site-packages (3.0.2)

PyCharm → PreferenceDefault Interpreter

So, I had to change the default interpreter and then it started working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.