Ubuntu – Numpy broken in Ubuntu 16.04 LTS

aptnumpypackage-managementpython

I have installed the package python-numpy on Ubuntu 16.04 LTS.
Unfortunately, the package is broken:

>>> import numpy
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 180, in <module>
 from . import add_newdocs
 File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
 from numpy.lib import add_newdoc
 File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
 from .type_check import *
 File "/usr/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
 import numpy.core.numeric as _nx
 File "/usr/lib/python2.7/dist-packages/numpy/core/__init__.py", line 14, in <module>
 from . import multiarray
 ImportError: cannot import name multiarray

Does Python often get broken in Ubuntu? Numpy is a pretty basic package.

Best Answer

  • OP solved the problem:

    ...I found the problem. I was using the wrong python since I had installed anaconda. Removing anaconda make the system works

  • An alternative way without uninstalling Anaconda, reset python link to default (pointing to python2 from repository)

    $ ls -l /usr/bin/python
    lrwxrwxrwx 1 root root 9 Dec 10  2015 /usr/bin/python -> python2.7
    
Related Question