python安装找不到硬盘_python2.7下安装theano
今下午在新硬盤上面重新升級Python2.7的時候,升級完之后,發現pip還是不行,使用“# wget
https://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 object
file: No such file or directory
一?原因分析
由于在系統的lib路徑中找不到這個共享庫。
注: 如果編譯時加上了--enable-shared,才會編譯這個共享庫,默認的位置是Python可執行程序所在目錄的lib目錄下,如/usr/local/python27
二 解決方法
1. 可以使用如下方式編譯Python以解決這個問題:
./configure
--enable-shared --prefix=/usr/local/python27
make && make
install
2.
cp?/usr/local/python27/lib/libpython2.7.so.1.0?/usr/local/lib
cd?/usr/local/lib
ln
-s?libpython2.7.so.1.0?libpython2.7.so
3. 使用命令whereis
libpython2.7.so.1.0得到如下結果就說明
libpython2.7.so.1:
/usr/local/lib/libpython2.7.so.1.0
4. 如果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)
總結
以上是生活随笔為你收集整理的python安装找不到硬盘_python2.7下安装theano的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html代码style图片width,H
- 下一篇: ironpython3桌面开发_Iron