报错内容:
- 类型一
bash
# git clone https://github.com/pytorch/vision.git
Cloning into 'vision'...
/usr/libexec/git-core/git-remote-https: symbol lookup error: /usr/lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_1_1_0
- 类型二
bash
# yum reinstall openssl
Traceback (most recent call last):
File "/usr/bin/yum", line 57, in <module>
from dnf.cli import main
ModuleNotFoundError: No module named 'dnf'
报错原因:
- python环境变量设置了绝对路径,删除虚拟环境后找不到python了
/etc/profile
配置文件或~/.bashrc
配置文件被改写
解决方案
临时解决
bash
unset LD_LIBRARY_PATH
永久解决
注释掉 /etc/profile
文件和~/.bashrc
文件中,含 LD_LIBRARY_PATH
的行
然后更新source ~/.bashrc