python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory


在linux下運行程序時,發現了error while loading shared libraries這種錯誤,一時間不知道解決辦法,在網上搜索,終於解決了:

./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory
出現這類錯誤表示,系統不知道xxx.so放在哪個目錄下,這時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。

一般而言,有很多的so會存放在/usr/local/lib這個目錄底下,去這個目錄底下找,果然發現自己所需要的.so文件。

所以,在/etc/ld.so.conf中加入/usr/local/lib這一行,保存之后,再運行:/sbin/ldconfig –v更新一下配置即可。

查找文件

find / -name libpython2.7.so.1.0

刷新

ldconfig

原文鏈接:https://blog.csdn.net/dumeifang/article/details/2963223


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM