I am using Ubuntu 14.04 and it has python 3 installed in default. I have installed numpy and scipy for python 3 using the Ubuntu package manager but not pip:
apt-get install python3-numpy python3-scipy
When I run a script with python3, it seems that it used the numpy installed with python 2.7:
python3 script.py
Original exception was:
Traceback (most recent call last):
...
line 18, in <module>
import numpy as np
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 170, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 6, in <module>
from . import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: _Py_ZeroStruct
I do not want to mess up python2.7 and python3 and those corresponding numpy and scipy. How do I set the pointer that python3 uses its numpy given the way I installed numpy for python3?