freude
freude

Reputation: 3832

PyCharm and external libraries

I have started to use PyCharm IDE, but I was not able to determine how to manage external libraries there. For instance, PyCharm does not see matplotlib. In PyCharm's file manager, I clearly see the list of external libraries and there is no matplotlib. However, I have it installed and I know its location.

How can I add this library to PyCharm environment?

Upvotes: 28

Views: 69936

Answers (5)

ilya
ilya

Reputation: 1

Solve this problem by choosing system interpretator.

Upvotes: 0

Mamuns
Mamuns

Reputation: 11

Install matplotlib and then python-tk.Pycharm will function well.It's working for me at Ubuntu 16.04.

sudo apt-get install python-tk

sudo apt-get install python-matplotlib

Upvotes: 1

Akash Kandpal
Akash Kandpal

Reputation: 3386

For Linux Users here is a solution , firstly write this command in the terminal ,

sudo apt-get install python-matplotlib

Now you're done you will be able to see matplotlib in File>>>settings>>project interpreter. Image

Upvotes: 0

kukido
kukido

Reputation: 10601

I suggest to use Python virtual environment. It is really easy with PyCharm.

PyCharm > Preferences... > Project Interpreter > Python Interpreters

Click "Create Virtual Environment" and pick your base interpreter.

enter image description here

Click "Install" and install any packages you need. You can also add other repositories if the default ones do not contain required libraries. Another benefit is that you can see which libraries have newer version and can be updated.

enter image description here

Upvotes: 53

arbulgazar
arbulgazar

Reputation: 1973

I think one way to solve a problem is to specify your interpreter in PyCharm itself via File -> Settings -> Python Interpreters

There is also a Paths tab in this setting, you need to add path to your matplotlib explicitly there. But for me there is no special path listed there. Here are my paths in this tab:

file://D:/hg_work/vefw_regression/tools/python/DLLs
file://D:/hg_work/vefw_regression/tools/python/Lib
file://D:/hg_work/vefw_regression/tools/python/Lib/lib-tk
file://D:/hg_work/vefw_regression/tools/python
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages (my matplotlib/numpy and other stuff is here)
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/win32
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/win32/lib
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/pythonwin
file://D:/Users/svecovs/AppData/Roaming/JetBrains/PyCharm Community Edition 3.0.1/helpers/python-skeletons
file://D:/hg_work/vefw_regression/tools/python/Lib/site-packages/core (added by user)

Upvotes: 5

Related Questions