Linux环境下python3安装失败

CentOS6.0环境下安装python3:V3.7.2
1.下载python3的安装包,我放到一个地方/usr/download/
2.解压该安装包:tar -zxvf Python-3.7.2.tgz
3.在usr/下面新建一个python3的包:
cd /usr/
mkdir python3
4.把刚才解压的Python-3.7.2放到usr下面
5.然后进入Python-3.7.2目录下面设置python3的环境变量目录
cd Python-3.7.2/
./configure --prefix=/usr/python3
6.安装 make ,后make install
结果报错:ImportError: No module named ‘_ctypes’
7.安装以下各个模块
sudo yum -y install gcc gcc-c++
sudo yum -y install zlib zlib-devel
sudo yum -y install libffi-devel
make
make install
###成功的结果
Looking in links: /tmp/tmp8ygdf551
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-18.1 setuptools-40.6.2
8.这个时候使用python3显示出python3的版本及相关信息
这个时候python2和python3共存了

你可能感兴趣的:(配置)