教程集 www.jiaochengji.com
教程集 >  Python编程  >  Python入门  >  正文 centos如何安装python2.7

centos如何安装python2.7

发布时间:2021-05-14   编辑:jiaochengji.com
教程集为您提供centos如何安装python2.7等资源,欢迎您收藏本站,我们将为您提供最新的centos如何安装python2.7资源

centos如何安装python2.7?步骤如下:

1、先安装 GCC 包,如果没安装 GCC 包,就输入以下命令行安装;

(*注:以下记得使用 su 权限)

python学习网,大量的免费python视频教程,欢迎在线学习!

yum install gcc openssl-devel bzip2-devel

2、用 wget 下载 python 2.7 并解压

如果没有 wget,先用下面命令安装 wget;

yum -y install wget 

相关推荐:《Python教程》

进入目录 /usr/src  再用 wget 下载 python 2.7

cd /usr/src
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz

再解压 python2.7

tar -zxvf Python-2.7.15.tgz

3、安装 python 2.7

进入上面解压的 Python-2.7.15 解压文件中使用下面命令行安装

cd Python-2.7.15
./configure --enable-optimizations
make altinstall

4、查看安装版本

python -V

可以看到输出 Python 2.7.15 就安装完成。

您可能感兴趣的文章:
centos如何安装python2.7
python如何安装包
CentOS 6上安装php-mcrypt扩展的方法
centos中如何安装python3?
Centos安装libxml2 'bin/rm: cannot remove libtoolT'...的解决方法
centos和win7双系统时间错误的问题
mac如何安装python3
centos创建Mysql用户组的方法
如何在CentOS / RHEL 6.10上安装PHP( 7.3,7.2,7.1)?
CentOS 5服务器安全基本设置

[关闭]
~ ~