Unable to import python packages in Ubuntu (ImportError : undefined symbol)
<p>I recently installed python on my Ubuntu 14.04. I downloaded tensorflow by <code>pip</code>.
When I tried to <code>import tensorflow</code> it said <code>ImportError:No module named tensorflow</code>.
Then I edited <code>PYTHONPATH</code> by adding <code>/usr/local/lib/python2.7/dist-packages</code>. Now when I try to import, it says </p>

<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 23, in &lt;module&gt;
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 45, in &lt;module&gt;
    import numpy as np
  File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 180, in &lt;module&gt;
    from . import add_newdocs
  File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in &lt;module&gt;
    from numpy.lib import add_newdoc
  File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in &lt;module&gt;
    from .type_check import *
  File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in &lt;module&gt;
    import numpy.core.numeric as _nx
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 14, in &lt;module&gt;
    from . import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString
</code></pre>

<p>I found <a href="http://stackoverflow.com/questions/27383054/python-importerror-usr-local-lib-python2-7-lib-dynload-io-so-undefined-symb">here</a> that 2 versions of python causes the conflict, but that didn't help. Any assistance will be appreciated. Thank you </p>

<p>Best way to install packages if you have more than one python installed is:</p>

<pre><code>path_to_your_python_executable -m pip install package_name
</code></pre>

<p>This way, you can make sure that you have installed package for proper python.</p>

<p>And don't forget about sudo ;)</p>

python python-2.7 ubuntu ubuntu-14.04 tensorflow