网站开发工具 枫子科技,上海好公司排名前十,重庆网站建设优化,微信手机网站开发今下午在新硬盘上面重新升级Python2.7的时候#xff0c;升级完之后#xff0c;发现pip还是不行#xff0c;使用“# wgethttps://bootstrap.pypa.io/ez_setup.py -O - |python”提示找不到libpython2.7.so.1.0#xff0c;经过查找#xff0c;可以使用如下方法解决#xff…今下午在新硬盘上面重新升级Python2.7的时候升级完之后发现pip还是不行使用“# wgethttps://bootstrap.pypa.io/ez_setup.py -O - |python”提示找不到libpython2.7.so.1.0经过查找可以使用如下方法解决#########################################使用源代码的方式安装Python2.7之后在import某些库时抛出了如下异常ImportError: libpython2.7.so.1.0: cannot open shared objectfile: No such file or directory一 原因分析由于在系统的lib路径中找不到这个共享库。注 如果编译时加上了--enable-shared才会编译这个共享库默认的位置是Python可执行程序所在目录的lib目录下如/usr/local/python27二 解决方法1. 可以使用如下方式编译Python以解决这个问题./configure--enable-shared --prefix/usr/local/python27make makeinstall2.cp /usr/local/python27/lib/libpython2.7.so.1.0 /usr/local/libcd /usr/local/libln-s libpython2.7.so.1.0 libpython2.7.so3. 使用命令whereislibpython2.7.so.1.0得到如下结果就说明libpython2.7.so.1:/usr/local/lib/libpython2.7.so.1.04. 如果whereis没有结果或者还有import错误可以尝试如下操作在/etc/ld.so.conf中加入新行/usr/local/lib保存后运行/sbin/ldconfig/sbin/ldconfig –v##################################################最后就是很多错误重启机器之后就没有了参考文献http://blog.csdn.net/jcjc918/article/details/11022345 (升级python 2.7)https://pypi.python.org/pypi/setuptools (centos安装setuptools)http://stackoverflow.com/questions/21342931/error-importing-theano(带参数编译python2.7)http://taoo.iteye.com/blog/1826912 (关键博文)http://blog.csdn.net/huzhenwei/article/details/7339548 (解决libpython2.7.so.1.0)