Unable to import numpy: Error: /usr/lib/liblapack.so.3: undefined symbol: gotoblas

喜欢而已 提交于 2019-12-01 15:33:56

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!