title: numpy/core/multiarray.so: undefined symbol: _Py_ZeroStruct
body: <p>I'm new to both Linux and Python. I'm working on a Ubuntu 16.04. </p>
  
  <p>My original Python is</p>
  
  <p><code>python --version
   Python 2.7.8</code></p>
  
  <p>I'm trying to import numpy into python3. However, when I try to import numpy I get this error</p>
  
  <blockquote>
    <p>Traceback (most recent call last): </p>
    
    <blockquote>
      <p>File "/usr/local/lib/python2.7/dist-packages/numpy/core/<strong>init</strong>.py", line
      16, in  from . import multiarray 
      ImportError:
      /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so:
      undefined symbol: _Py_ZeroStruct </p>
    </blockquote>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <blockquote>
      <p>Traceback (most recent call
      last): File "", line 1, in  File
      "/usr/local/lib/python2.7/dist-packages/numpy/<strong>init</strong>.py", line 142,
      in  from . import add_newdocs File
      "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line
      13, in  from numpy.lib import add_newdoc File
      "/usr/local/lib/python2.7/dist-packages/numpy/lib/<strong>init</strong>.py", line
      8, in  from .type_check import * File
      "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line
      11, in  import numpy.core.numeric as _nx File
      "/usr/local/lib/python2.7/dist-packages/numpy/core/<strong>init</strong>.py", line
      26, in  raise ImportError(msg)  </p>
    </blockquote>
    
    <p>ImportError: Importing the multiarray numpy extension module failed.</p>
    
    <blockquote>
      <p>Most likely you are trying
      to import a failed build of numpy. 
      If you're working with a numpy git
      repo, try git clean -xdf (removes all files not under version
      control). Otherwise reinstall numpy.  </p>
    </blockquote>
    
    <p>Original error was:</p>
    
    <blockquote>
      <p>/usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so:
      undefined symbol: _Py_ZeroStruct"</p>
    </blockquote>
  </blockquote>
  
  <p>The python I'm using to import numpy is Python 3.5.2 and it seems to be trying to use the package in Python 2.7. </p>
  
  <h2>I've tried :</h2>
  
  <pre><code>sudo apt-get update
  sudo apt-get install python3-pip
  sudo apt-get install python3-numpy
  </code></pre>
  
  <h2>and also :</h2>
  
  <pre><code>sudo python3 -m pip uninstall pip &amp;&amp; sudo apt install python3-pip --reinstall 
  sudo apt install python3-numpy python3-scipy
  </code></pre>
  
  <p>It seems a similar problem to what others have faced but none of the solutions seem to work?</p>