简体   繁体   English

如何安装libpython2.7.so

[英]How to install libpython2.7.so

I have installed Python 2.6.6 at 我已经安装了Python 2.6.6

[17:50:21 root@data.dev:~]# which python
/usr/local/bin/python

also Python 2.7.6 at 还有Python 2.7.6

[17:51:12 root@data.dev:~]# which python2.7
/usr/local/bin/python2.7

But libpython2.7.so is missing 但缺少libpython2.7.so

[17:48:52 root@data.dev:~]# locate libpython2.6.so
/usr/lib64/libpython2.6.so
/usr/lib64/libpython2.6.so.1.0
/usr/lib64/python2.6/config/libpython2.6.so
[17:48:56 root@data.dev:~]# locate libpython2.7.so
[17:49:02 root@data.dev:~]#

Dont know how to fix this. 不知道如何解决这个问题。

can anyone help ? 有人可以帮忙吗?

You could try compiling it from sources, in root : 你可以尝试从root中的源代码编译它:

yum -y install python-devel openssl openssl-devel gcc sqlite-devel

wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
tar -xvjf Python-2.7.5.tar.bz2
cd Python-2.7.5
./configure --prefix=/usr/local/python2.7 --with-threads --enable-shared
make
make install altinstall

ln -s /usr/local/python2.7/lib/libpython2.7.so /usr/lib
ln -s /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/lib
ln -s /usr/local/python2.7/bin/python2.7 /usr/local/bin
/sbin/ldconfig -v

Then test getting correct python /usr/local/python2.7/bin/python2.7 -V 然后测试得到正确的python /usr/local/python2.7/bin/python2.7 -V

And, as normal user : 并且,作为普通用户:

echo "alias python='/usr/local/python2.7/bin/python2.7'" >> ~/.bashrc
source ~/.bashrc
python -V    

Good luck :) 祝好运 :)

For Pip you need openssl, Please install the below pkgs , before you go for pip openssl.x86_64 对于Pip你需要openssl,请在你去pip openssl.x86_64之前安装下面的pkgs
openssl-devel.x86_64 OpenSSL的,devel.x86_64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在制作二进制文件时,PyInstaller找不到libpython2.7.so? - PyInstaller cannot find libpython2.7.so when making binary? 从AIX5.3上的Source构建的Python 2.7无法为libpython2.7.so执行 - Python 2.7 built from Source on AIX5.3 does not execute for libpython2.7.so yum未找到libpython2.7.so.1.0()(64bit) - libpython2.7.so.1.0()(64bit) not found by yum 在Python 2.7.13 Heroku dynos上缺少libpython2.7.so.1.0 - Missing libpython2.7.so.1.0 on Python 2.7.13 Heroku dynos Docker:libpython2.7.so.1.0:无法打开共享对象文件:没有这样的文件或目录 - Docker: libpython2.7.so.1.0: cannot open shared object file: No such file or directory libpython2.7.so.1.0:无法打开共享对象文件:没有这样的文件或目录 - libpython2.7.so.1.0: cannot open shared object file: No such file or directory 加载共享库时出错:在ubuntu中制作虚拟环境时,libpython2.7.so.1.0 - error while loading shared libraries: libpython2.7.so.1.0 when making virtual env in ubuntu Linux上的MATLAB MEX文件无法在libpython.2.7.so中找到符号 - MATLAB MEX file on Linux fails to find symbols in libpython.2.7.so cygwin中的libpython2.7.dll.a - libpython2.7.dll.a in cygwin 将“ libpython2.7.a”版本从2.7.5更改为2.7.6,以安装opencv 2.4.9 - change “libpython2.7.a” version to 2.7.6 from 2.7.5 to install opencv 2.4.9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM