在 RedHat/Centos 上安装 Python 2.5

Eog*_*anM 8 redhat python

当前的 Python 版本是 2.4 ...

yum upgrade python
Run Code Online (Sandbox Code Playgroud)

Could not find update match for python
Run Code Online (Sandbox Code Playgroud)

我必须从源代码安装吗?

tim*_*mmy 10

./configure 
make 
make install
Run Code Online (Sandbox Code Playgroud)

命令应如下(根据 2.7 的 README)

./configure 
make
make altinstall
Run Code Online (Sandbox Code Playgroud)

请参阅自述文件中的“安装多个版本”部分。


小智 9

是的,您需要从源代码安装,您可以使用以下方法:

wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
tar fxz Python-2.5.2.tgz
cd Python-2.5.2
./configure
make
make install
Run Code Online (Sandbox Code Playgroud)

这将安装 Python 2.5 作为命令 python2.5,因为 yum 和 CentOS 的其他部分需要旧的 Python 2.4,因此您将安装两个版本的 Python。

/usr/bin/python - 2.4.3
/usr/bin/python2.5 - 2.5
Run Code Online (Sandbox Code Playgroud)

  • 下面蒂米的回答很可能更正确;仅仅是“make install”就可能会无情地打击您现有的 Python 安装并破坏您的盒子。 (3认同)