当您安装了libopenblas-base和libatlas3-base但未安装liblapack3时会出现此问题。这种包组合安装了libblas.so(来自 OpenBLAS)和liblapack.so(来自 ATLAS)的冲突版本。
解决方案 1(我最喜欢的):如果您还安装了liblapack3 ,则可以在您的机器上同时保留 OpenBLAS 和 ATLAS 。
sudo apt-get install liblapack3
解决方案 2:卸载 ATLAS(由于一些 deb 包的恶作剧,这实际上会自动为您安装liblapack3 )
sudo apt-get uninstall libatlas3-base
解决方案 3:卸载 OpenBLAS
sudo apt-get uninstall libopenblas-base
配置错误
$ dpkg -l | grep 'openblas\|atlas\|lapack'
ii libatlas3-base 3.10.1-4 amd64 Automatically Tuned Linear Algebra Software, generic shared
ii libopenblas-base 0.2.8-6ubuntu1 amd64 Optimized BLAS (linear algebra) library based on GotoBLAS2
$ update-alternatives --get-selections | grep 'blas\|lapack'
libblas.so.3 auto /usr/lib/openblas-base/libblas.so.3
liblapack.so.3 auto /usr/lib/atlas-base/atlas/liblapack.so.3
$ python -c 'import numpy'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/dist-packages/numpy/linalg/__init__.py", line 50, in <module>
from .linalg import *
File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: /usr/lib/liblapack.so.3: undefined symbol: ATL_chemv
解决方案 1
$ dpkg -l | grep 'openblas\|atlas\|lapack'
ii libatlas3-base 3.10.1-4 amd64 Automatically Tuned Linear Algebra Software, generic shared
ii liblapack3 3.5.0-2ubuntu1 amd64 Library of linear algebra routines 3 - shared version
ii libopenblas-base 0.2.8-6ubuntu1 amd64 Optimized BLAS (linear algebra) library based on GotoBLAS2
$ update-alternatives --get-selections | grep 'blas\|lapack'
libblas.so.3 auto /usr/lib/openblas-base/libblas.so.3
liblapack.so.3 auto /usr/lib/lapack/liblapack.so.3
$ python -c 'import numpy'
解决方案 2
$ dpkg -l | grep 'openblas\|atlas\|lapack'
ii liblapack3 3.5.0-2ubuntu1 amd64 Library of linear algebra routines 3 - shared version
ii libopenblas-base 0.2.8-6ubuntu1 amd64 Optimized BLAS (linear algebra) library based on GotoBLAS2
$ update-alternatives --get-selections | grep 'blas\|lapack'
libblas.so.3 auto /usr/lib/openblas-base/libblas.so.3
liblapack.so.3 auto /usr/lib/lapack/liblapack.so.3
$ python -c 'import numpy'
解决方案 3
$ dpkg -l | grep 'openblas\|atlas\|lapack'
ii libatlas3-base 3.10.1-4 amd64 Automatically Tuned Linear Algebra Software, generic shared
$ update-alternatives --get-selections | grep 'blas\|lapack'
libblas.so.3 auto /usr/lib/atlas-base/atlas/libblas.so.3
liblapack.so.3 auto /usr/lib/atlas-base/atlas/liblapack.so.3
$ python -c 'import numpy'