How to install libpython2.7.so

I installed Python 2.6.6 on

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

also Python 2.7.6 on

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

But libpython2.7.so is missing

 [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 :~]# 

I don’t know how to fix it.

can anyone help?

+7
python linux sysadmin centos
source share
2 answers

You can try compiling it from sources, at the 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 check the correctness of the python / usr / local / python 2.7 / bin / python2.7 -V

And, as a regular user:

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

Good luck :)

+13
source share

For pip you need openssl, please install below pkgs before going to pip openssl.x86_64
Openssl-devel.x86_64

0
source share

All Articles