I can not import caffe in pycharm but i can import in terminal. Why?
<p>I want to import caffe. I can import it in terminal but not in pycharm.</p>

<p>I have tried some suggestions like adding <code>include /usr/local/cuda-7.0/lib64</code> to <code>/user/etc/ld.so.conf</code> file but still it can not import this module. However, I think this is not a good solution as I am using the CPU mode only.</p>

<p><a href="http://i.stack.imgur.com/l2q3S.png" rel="nofollow"><img src="http://i.stack.imgur.com/l2q3S.png" alt="enter image description here"></a></p>

<p>I am using linux mint. </p>

<p>The output for <code>sys.path</code> in pycharm terminal is:</p>

<pre><code>&gt;&gt;&gt; sys.path
['', 
'/home/user/anaconda2/lib/python27.zip', 
'/home/user/anaconda2/lib/python2.7', 
'/home/user/anaconda2/lib/python2.7/plat-linux2', 
'/home/user/anaconda2/lib/python2.7/lib-tk', 
'/home/user/anaconda2/lib/python2.7/lib-old', 
'/home/user/anaconda2/lib/python2.7/lib-dynload', 
'/home/user/anaconda2/lib/python2.7/site-packages', 
'/home/user/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.1-y2.7.egg',
'/home/user/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg']
&gt;&gt;&gt; 
</code></pre>

<p>and when I run <code>sys.path</code> in pycharm itself, I get:</p>

<pre><code> ['/opt/pycharm-community-2016.2.3/helpers/pydev',
 '/home/user/',
 '/opt/pycharm-community-2016.2.3/helpers/pydev',
 '/home/user/anaconda2/lib/python27.zip',
 '/home/user/anaconda2/lib/python2.7',
 '/home/user/anaconda2/lib/python2.7/plat-linux2',
 '/home/user/anaconda2/lib/python2.7/lib-tk',
 '/home/user/anaconda2/lib/python2.7/lib-old',
 '/home/user/anaconda2/lib/python2.7/lib-dynload',
 '/home/user/anaconda2/lib/python2.7/site-packages',
 '/home/user/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.1-py2.7.egg',
 '/home/user/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg',
 '/home/user/anaconda2/lib/python2.7/site-packages/IPython/extensions',
 '/home/user/']
</code></pre>

<p>which is not exactly the same as the time I ran it in terminal.</p>

<p>moreover, as I run the <code>import caffe</code> in pycharm the error is as bellow:</p>

<pre><code>/home/user/anaconda2/bin/python /home/user/important_commands.py
Traceback (most recent call last):
  File "/home/user/important_commands.py", line 11, in &lt;module&gt;
    import caffe
ImportError: No module named caffe

Process finished with exit code 1
</code></pre>

<p>could you please help me?</p>

<p>I installed caffe using pycharm terminal too but it did not work. Finally I added <code>sys.path.extend([/home/user/caffe-master/python])</code> to python consule and meanwhile I wrote the following in my code.</p>

<pre><code> import sys
 sys.path.append("/home/user/caffe-master/python/")
 import caffe
</code></pre>

<p>and it worked!!!</p>

python pycharm caffe