如何findCentOS 5.0的libpython2.6.so.1.0?

我在CentOS下search了rpmfind.net并找不到它 。

但是我的服务器上已经安装了python-libs 2.4.3-46.el5_8.2

# yum provides *libpython2.6* ... python26-libs-2.6.8-1.el5.x86_64 : The libraries for python runtime Repo : epel Matched from: Filename : /usr/lib64/libpython2.6.so.1.0 Other : libpython2.6.so.1.0()(64bit) 

我也找不到它。 但是,你可以随时编译它。

 wget http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tgz tar xzf Python-2.6.7.tgz ./configure --prefix=/opt/python2.6 --with-threads --enable-shared --with-zlib=/usr/include make && make install sudo ln -s /opt/python2.6/lib/libpython2.6.so /usr/lib sudo ln -s /opt/python2.6/lib/libpython2.6.so.1.0 /usr/lib sudo /sbin/ldconfig -v sudo ln -s /opt/python2.6/bin/python /usr/local/python 

您现在可以用python -V来检查版本。

你也可能想检查yum是否还在工作,因为这通常是你开始使用python版本时首先要去的地方。

上面的代码来自我使用的安装脚本,并且假设你在/opt构build了所有的东西

如果你真的需要在旧的CentOS 5盒子上使用Python 2.6,你可以使用EPEL提供的python26软件包 。