title: Cannot import caffe2 from caffe2.python?
body: <p>I'm trying to install caffe2 on macbook pro. I followed the official instructions:
  <a href="https://caffe2.ai/docs/getting-started.html?platform=mac&amp;configuration=compile#python-configuration" rel="nofollow noreferrer">https://caffe2.ai/docs/getting-started.html?platform=mac&amp;configuration=compile#python-configuration</a></p>
  
  <p>I built it from source successfully, but when I try the command:</p>
  
  <pre><code>~/anaconda2/bin/python -c 'from caffe2.python import core' 2&gt;/dev/null &amp; echo "Success" | echo "Failure"
  </code></pre>
  
  <p>It says：</p>
  
  <pre><code>Failure
  '~/anaconda2/bin/python -c 'from…' has ended
  </code></pre>
  
  <p>I have no idea what is wrong with it.
  My computer has two different versions of python. The default one is python 2.7.10 in the directory '/usr/bin/python'.  Another one is python 2.7.13 in the directory '~/anaconda2/bin'. I do not know which one it use. With the command:</p>
  
  <pre><code>mkdir build &amp;&amp; cd build
  cmake -DUSE_CUDA=OFF ..
  sudo make install
  </code></pre>
  
  <p>I installed it successfully. I also setup the <code>PYTHONPATH</code> environment variable <code>export PYTHONPATH="~/anaconda2/bin/"</code> in <code>~/.bash_profile</code> and execute the command:</p>
  
  <pre><code>sudo install_name_tool -change libpython2.7.dylib ~/anaconda2/lib/libpython2.7.dylib /usr/local/caffe2/python/caffe2_pybind11_state.so
  </code></pre>
  
  <p>Everything is OK until now. But when I execute:</p>
  
  <pre><code>~/anaconda2/bin/python -c 'from caffe2.python import core' 2&gt;/dev/null &amp; echo "Success" | echo "Failure"
  </code></pre>
  
  <p>It show "Failure", I also tried:</p>
  
  <pre><code>python -c 'from caffe2.python import core' 2&gt;/dev/null &amp; echo "Success" | echo "Failure"
  </code></pre>
  
  <p>and it did not work. What should I do?</p>