python-无法导入numpy:错误:/usr/lib/liblapack.so.3:未定义的符号:gotoblas

当我尝试导入numpy时,出现以下错误:

/usr/local/lib/python2.7/dist-packages/numpy/linalg/__init__.py in <module>()
     49 from .info import __doc__
     50 
---> 51 from .linalg import *
     52 
     53 from numpy.testing import Tester

/usr/local/lib/python2.7/dist-packages/numpy/linalg/linalg.py in <module>()
     27     )
     28 from numpy.lib import triu, asfarray
---> 29 from numpy.linalg import lapack_lite, _umath_linalg
     30 from numpy.matrixlib.defmatrix import matrix_power
     31 from numpy.compat import asbytes

ImportError: /usr/lib/liblapack.so.3: undefined symbol: gotoblas

我已经尝试过发布Error by import numpy: lapack_lite.so: undefined symbolGotoBLAS error when installing matplotlib with pip in a virtualenv on debian wheezy的解决方案

我已经尝试了以下所有选项:

vvkulkarni@galileo:~$sudo update-alternatives --config liblapack.so.3
There are 3 choices for the alternative liblapack.so.3 (providing /usr/lib/liblapack.so.3).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/openblas-base/liblapack.so.3      40        auto mode
  1            /usr/lib/atlas-base/atlas/liblapack.so.3   35        manual mode
  2            /usr/lib/lapack/liblapack.so.3             10        manual mode
  3            /usr/lib/openblas-base/liblapack.so.3      40        manual mode

我正在使用Ubuntu 14.1和python 2.7

最佳答案
为了解决这些问题,我在这里遵循了安装bash脚本:https://gist.github.com/amirsani/d2aa0763cc138902bf73

在所有安装结束时的测试过程中,我仍然遇到相同的错误,所以我这样做

sudo apt-get remove libopenblas-base

我从这里得到的:Installing lapack for numpy

这似乎已经解决了我尝试从ipython运行以下命令的原始问题(与您的问题类似,但不完全相同)

from ortools.linear_solver import pywraplp

产生的错误与您的错误相同.

转载注明原文:python-无法导入numpy:错误:/usr/lib/liblapack.so.3:未定义的符号:gotoblas - 代码日志