libpython2.7.so.1.0: cannot open shared object file: No such file or directory

解决方法如下:
1.编辑      vi /etc/ld.so.conf 
如果是非root权限帐号登录,使用 sudo vi /etc/ld.so.conf 
添加上python2.7lib库地址,如我的/home/python/Python2.7/Lib,保存文件
 
2.执行 /sbin/ldconfig -v命令,如果是非root权限帐号登录,使用 sudo  /sbin/ldconfig -v。这样 ldd 才能找到这个库,执行python2.7就不会报错了
 
/etc/ld.so.conf:
这个文件记录了编译时使用的动态链接库的路径。
默认情况下,编译器只会使用/lib和/usr/lib这两个目录下的库文件
如果你安装了某些库,没有指定 --prefix=/usr 这样lib库就装到了/usr/local下,而又没有在/etc/ld.so.conf中添加/usr/local/lib,就会报错了
原文地址:https://www.cnblogs.com/lifuhei/p/6807897.html