小编Yus*_*eri的帖子

在 Centos 6.5 上将 Python 从 2.6 升级到 2.7

我想在服务器上更新我的 Python 版本,我当前的 Python 版本是 2.6,我想将它升级到 2.7。Plesk 安装在我们的服务器中,我也可以访问 ssh。

如何在 Centos 6.5 中升级它?

我在下面尝试

下载 Python 并解压

wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz  
xz -d Python-2.7.8.tar.xz  
tar -xvf Python-2.7.8.tar  
Run Code Online (Sandbox Code Playgroud)

安装过程

# Enter the directory:
cd Python-2.7.8

# Run the configure:
./configure --prefix=/usr/local

# compile and install it:
make  
make altinstall
# Checking Python version:
[root@nicetry ~]# python2.7 -V
Python 2.7.8  
export PATH="/usr/local/bin:$PATH"  
Run Code Online (Sandbox Code Playgroud)

但是当我输入时python --version它返回2.6.6

linux ssh python

12
推荐指数
2
解决办法
7万
查看次数

标签 统计

linux ×1

python ×1

ssh ×1