My default binary for Python is set to the one that has the Anaconda Python distribution. It can be found in /home/karnivaurus/anaconda/bin/python, and I did it by default, added to my file is .bashrcthe following: export PATH=/home/karnivaurus/anaconda/bin:$PATH.
I also have a Python package called caffe, which is located in /home/karnivaurus/caffe/distribute/python, and I said it in the search path of the package, adding to my file is .bashrcthe following: export PYTHONPATH=${PYTHONPATH}:/home/karnivaurus/caffe/distribute/python.
Now I have a simple Python file called test.pywith the following contents:
import caffe
print "Done."
If I run this by typing python test.pyinto the terminal, it works fine by printing "Finish." The problem I am facing is that I am running it in PyCharm. In PyCharm, I installed the interpreter as /home/karnivaurus/anaconda/bin/python. But when I open test.pyin PyCharm and run the file in the IDE, I get the following error:
ImportError: No module named caffe
So my question is: why PyCharm cannot find the module caffewhen running the Python script, but can it be found when the script is run from the terminal?
Thanks!
source
share