安装python2.7

安装python2.7

1、下载
可从 http://www.python.org/进行下载
#wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz

2、复制解压

#mkdir -p /opt/usr/python

#cp  /opt/soft/Python-2.7.10.tgz /opt/usr/python

#cd  /opt/usr/python

#tar zxvf Python-2.7.10.tgz

<!--[if !supportLists]-->3、<!--[endif]-->安装

#cd Python-2.7.10

#./configure --prefix=/usr/local/Python2.7 --enable-shared

#make && make install

4、当出现libpython2.7.so.1.0的错误时

#./python

 ./python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

# /usr/local/Python2.7/bin/python2.7

/usr/local/Python2.7/bin/python2.7: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

libpython2.7.so.1.0的错误时的 解决办法:

#vi /etc/ld.so.conf 添加/usr/local/Python2.7/lib

#/sbin/ldconfig

#/sbin/ldconfig -v

 

你可能感兴趣的:(python)