具体错误是这样的
/usr/bin/python: error while loading shared libraries: libpython2.6.so.1.0: cannot open shared object file: No such file or directory
参考https://blog.youkuaiyun.com/tool163/article/details/9706165并没有什么用。
尝试查找文件libpython2.7.so.1.0:
locate libpython2.7.so.1.0
在我的情况下,它显示出来:
/opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0
然后将行粘贴 到/etc/ld.so.conf文件中。
vi /etc/ld.so.conf
/opt/rh/python27/root/usr/lib64
wq保存退出。
并运行
ldconfig
它解决了我的问题。
本文详细介绍了如何解决在使用Python时遇到的共享库加载错误,具体错误为找不到libpython2.6.so.1.0文件。通过定位到正确的共享库路径,并将其添加到ld.so.conf文件中,最后运行ldconfig命令,成功解决了这一问题。
3348

被折叠的 条评论
为什么被折叠?



