How to properly install python-numpy in Ubuntu 11.10 Oneiric

According to the Scipy site, on Ubuntu 11.10, numpy and scipy comes pre-packaged, so I did this:

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

Then I tried to call numpy in Python, but we get the error:

 ImportError: cannot import name datetime_data. 

Any ideas why this happened? A complete error message has been entered.


 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 
+6
source share
2 answers

It looks like you have a broken numpy installation in / usr / local / lib / python 2.7 / dist-packages, the package manager installs numpy in / usr / lib / pyshared / python 2.7

You have to remove broken numpy

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

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

+3
source

I had a similar problem after updating my numpy version. I decided to reinstall and delete the numpy lib folder (for your python version)

 sudo apt-get remove python-numpy sudo rm -r /usr/local/lib/pythonX.X/dist-packages/numpy sudo apt-get install python-numpy 

(or installing a new version of numpy from any numpy package)

0
source

Source: https://habr.com/ru/post/909371/


All Articles