3

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.

5
  • 1
    Is your system up-to-date? I have no problem with numpy. What is your python and numpy version? – salman Jun 23 '16 at 13:19
  • 1
    Sorry for message. I found the problem. I was using the wrong python since I had installed anaconda. Removing anaconda make the system works – Mathieu Dutour Sikiric Jun 23 '16 at 13:30
  • 2
    @MathieuDutourSikiric You should write an answer to let others on the site know how you solved your problem. And no, it is not frequent to have numpy broken on Ubuntu if you knew how to install it. – edwinksl Jun 23 '16 at 19:11
  • I had a similar problem, simply because my LD_LIBRARY_PATH included a directory with an incompatible Openblas – xiawi Aug 25 '16 at 7:49
  • 1
    VTR because this is yet another example of the perils of using Anaconda in Ubuntu. – karel Feb 24 '18 at 7:23
3
  • 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
    
2
  • Thank you for adding the answer. I don't know why they close this question. – Aerin Feb 23 '18 at 22:47
  • @ToussaintLouverture , I was one of close voters my reasons: from new user who didn't submit a answer but just mention a work around in comment without any further collaboration, no up-votes on question (but it was new anyway). Now I would change my mind as reason are not valid anymore: it get some interest from other users and also xiawi mention another option with better fit as answer. I'll as for reopening. Thank you. – user.dz Feb 24 '18 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.