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

本文介绍在Ubuntu系统中使用Numpy时遇到的导入错误问题,并提供了三种解决方案,包括安装liblapack3、卸载ATLAS或OpenBLAS。

在ubuntu下使用numpy出现如下问题:

zhangxin@seele:~/github/caffe$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] 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/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

解决方法:

This issue arises when you have libopenblas-base and libatlas3-base installed, but don't have liblapack3 installed. This combination of packages installs conflicting versions of libblas.so (from OpenBLAS) and liblapack.so (from ATLAS).

Solution 1 (my favorite): You can keep both OpenBLAS and ATLAS on your machine if you also install liblapack3.

sudo apt-get install liblapack3

Solution 2: Uninstall ATLAS (this will actually install liblapack3 for you automatically because of some deb package shenanigans)

sudo apt-get uninstall libatlas3-base

Solution 3: Uninstall OpenBLAS

sudo apt-get uninstall libopenblas-base

参考资料:
Installing lapack for numpy

`ImportError: /usr/lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_3.0.0` 错误通常是由于动态链接库版本不兼容导致的。以下是一些可能的解决方法: #### 1. 检查 OpenSSL 版本 确保系统中安装的 OpenSSL 版本与程序所依赖的版本一致。可以使用以下命令查看 OpenSSL 版本: ```bash openssl version ``` #### 2. 重新安装 OpenSSL 如果 OpenSSL 版本不兼容,可以尝试重新安装 OpenSSL。以下是在 CentOS/RHEL 系统上的示例命令: ```bash yum reinstall openssl openssl-devel ``` 在 Ubuntu/Debian 系统上: ```bash apt-get reinstall openssl libssl-dev ``` #### 3. 检查 LD_LIBRARY_PATH 环境变量 `LD_LIBRARY_PATH` 环境变量指定了动态链接库的搜索路径。确保该环境变量包含了正确的 OpenSSL 库路径。可以使用以下命令查看 `LD_LIBRARY_PATH` 的值: ```bash echo $LD_LIBRARY_PATH ``` 如果需要添加路径,可以使用以下命令临时设置: ```bash export LD_LIBRARY_PATH=/path/to/openssl/lib:$LD_LIBRARY_PATH ``` 若要永久设置,可以将上述命令添加到 `~/.bashrc` 或 `/etc/profile` 文件中。 #### 4. 软链接修复 如果系统中存在多个版本的 OpenSSL 库,可以尝试创建软链接来解决版本不兼容问题。例如: ```bash ln -s /path/to/openssl/lib/libssl.so.3.0.0 /usr/lib64/libssl.so.3 ln -s /path/to/openssl/lib/libcrypto.so.3.0.0 /usr/lib64/libcrypto.so.3 ``` #### 5. 重新编译程序 如果可能的话,重新编译使用 `libldap.so.2` 的程序,确保其与当前系统的 OpenSSL 版本兼容。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张欣-男

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值