How to correctly install python-numpy in Ubuntu 11.10 Oneiric

47,249

It looks like you have a broken numpy install in /usr/local/lib/python2.7/dist-packages, the package manager installs numpy to /usr/lib/pyshared/python2.7

You should remove the broken numpy

$ sudo rm -rf /usr/local/lib/python2.7/dist-packages/numpy

then the numpy you installed with apt-get should work as expected.

Share:
47,249
Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    According to Scipy website, in Ubuntu 11.10 numpy and scipy comes pre-packaged so what I did was:

    apt-get install python2.7
    apt-get install python-numpy
    apt-get install python-scipy
    

    Then I tried to call numpy in Python but get an error:

    ImportError: cannot import name datetime_data.
    

    Any ideas why this happened? Full error message attached.


    Python 2.7.2+ (default, Oct  4 2011, 20:03:08)
    [GCC 4.6.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 137, in <module>
        import add_newdocs
      File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 9, in <module>
        from numpy.lib import add_newdoc
      File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 4, in <module>
        from type_check import *
      File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 8, in <module>
        import numpy.core.numeric as _nx
      File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 8, in <module>
        import numerictypes as nt
      File "/usr/local/lib/python2.7/dist-packages/numpy/core/numerictypes.py", line 92, in <module>
        from numpy.core.multiarray import typeinfo, ndarray, array, \
    ImportError: cannot import name datetime_data