When I try to import numpy, I get the following error:
/usr/local/lib/python2.7/dist-packages/numpy/linalg/__init__.py in ()
49 from .info
To solve these issues, I followed the install bash script here: https://gist.github.com/amirsani/d2aa0763cc138902bf73
I still had the same error occur during testing at the ending of all the installation so I did this
sudo apt-get remove libopenblas-base
Which I got from here: Installing lapack for numpy
This appears to have solved my original problem (similar to yours but not identical) where I was attempting to run the following from ipython
from ortools.linear_solver import pywraplp
which produced an identical error to the one you had.
The error message shows that your numpy installation is in '/usr/local/lib', but apt-get will put numpy in '/usr/lib'. This suggests to me that you have another copy of numpy which was installed by another method (e.g. pip install
). Check if you have a directory called /usr/lib/python2.7/dist-packages/numpy/
. If so, you just need to make sure that Python imports numpy from here and not from '/usr/local/lib'.
Try deleting, renaming or moving the directory /usr/local/lib/python2.7/dist-packages/numpy/
, alternatively you can change sys.path
from within Python.