Import of external library fails. But same code runs in the vanilla interpreter

Hello Everyone,
I am using PyCharm on Ubuntu 14.04 along with Anaconda python 2.7 interpreter. I am in a fix regarding the import of a custom built module called caffe.The following is the code

import sys
caffe_root = '/home/rick/caffe_check/caffe'  
sys.path.insert(0, caffe_root + 'python')
import caffe

It fails and says no module named caffe found. The directory structure has a caffe folder with __init__.pyc and everything required. The first time I installed PyCharm it was indeed working like a charm with the same code. After a restart it stopped working. Moreover the same code works if I start the Anaconda interpreter from commandline, or in Spyder, or IPython or anywhere else.

I am in dire need of debugging the code and none of the other options are suitable. Please help me.

Please sign in to leave a comment.