1 寻找下载链接地址
pyhton 下载主页
https://www.python.org/downloads/source/
找到自己需要的版本,并且复制下载链接
https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
上面是我用的3.7,目前最高版本
2 下载
cd 下载目录
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
3 解压
tar -xvf Python-3.7.1.tar.xz
cd Python-3.7.1
4 安装
make && make install
安装时我遇到了,错误
make: *** No targets specified and no makefile found. Stop.
执行
yum update
yum install gcc build-essential
yum install gcc gcc-c++ autoconf automake
./configure
后 ,在
make && make install
遇到 错误
ModuleNotFoundError: No module named '_ctypes'
安装
yum install libffi-devel -y
后再次
make && make install
安装成功
[root@*** /]# python3
Python 3.7.1 (default, Dec 4 2018, 15:12:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Python 3.7.1 安装成功