0

I'm using PyCharm in Ubuntu 14.04. So when I use iPython I can see the libraries that I am using by:

$ import sys
$ print sys.path

results:

['', '/home/alireza/anaconda2/bin', '/home/alireza/anaconda2/lib/python2.7/site-packages/opendeep-0.0.9a0-py2.7.egg', '/home/alireza/anaconda2/lib/python27.zip', '/home/alireza/anaconda2/lib/python2.7', '/home/alireza/anaconda2/lib/python2.7/plat-linux2', '/home/alireza/anaconda2/lib/python2.7/lib-tk', '/home/alireza/anaconda2/lib/python2.7/lib-old', '/home/alireza/anaconda2/lib/python2.7/lib-dynload', '/home/alireza/anaconda2/lib/python2.7/site-packages/Sphinx-1.3.5-py2.7.egg', '/home/alireza/anaconda2/lib/python2.7/site-packages/setuptools-20.2.2-py2.7.egg', '/home/alireza/anaconda2/lib/python2.7/site-packages', '/home/alireza/anaconda2/lib/python2.7/site-packages/cryptography-1.0.2-py2.7-linux-x86_64.egg', '/home/alireza/anaconda2/lib/python2.7/site-packages/IPython/extensions', '/home/alireza/.ipython']

I can import the libraries in iPython but they do not work in PyCharm.

How can I insert all of these paths and libraries into PyCharm. Right now my PyCharm does not recognize most of these libraries.

If you are familiar with deep learning libraries, I am using Anaconda, Theano, Lasagne, but none of them are added to my PyCharm. however they all work fine in iPython.

In other words, how I can add all the paths that I have in my iPython to my PyCharm path.

jaydez
  • 153
  • 8
Alex
  • 1,194
  • 1
  • 12
  • 20

1 Answers1

2

PyCharm includes a package management interface which can be found in File > Settings > Project Interpreter if you use a packaging tool like PyPi. If it is the case that you do not have a package manager installed, PyCharm will prompt you to install one at this screen:

Install package

Then you can install the packages you want locally:

Choose to install

Search for the correct packages, click "Install to user's site packages", and select the version you would like to use before clicking "Install Package":

Install Package

Edit: I have added a more detailed description of PyCharm's built-in package management. I find it useful to do all this work inside PyCharm, but it will be a little different than how you currently set up your project if you are not putting all the libraries into the preconfigured python paths.

jaydez
  • 153
  • 8
  • I dont know how it works. I appreciate it if you can explain more. I've seen people mentioned to go to File > Settings > Project Interpreter. but I could not make it work yet. – Alex Mar 31 '16 at 01:46
  • I've added some notes about installing a package manager and using it to install the packages you'd like. – jaydez Mar 31 '16 at 14:39
  • 1
    Try the following. Check where your python, which is working on the command line, is with `which python`. Now set the python at that path to be your Project Interpreter in PyCharm. You can do that by clicking the gear in the upper right corner, selecting "Add Local", and inputting the python that you found with `which python`. The packages that you see in your command line python should also be visible in PyCharm now. – Paul Mar 31 '16 at 14:43