- 安装依赖
sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
- 下载python3.6
https://www.python.org/ftp/python/
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar -zxvf Python-3.6.4.tgz #解压
- 进入文件夹并编译
cd Python-3.6.4
sudo ./configure --prefix=/usr/python
#这里配置自己的安装目录,接下来编译源码```
make #编译源码
sudo make install#执行安装
- 建立软连接
都加sudo
# mv /usr/bin/python /usr/bin/python.bak
# ln -s /usr/python/bin/python3 /usr/bin/python
# ln -s /usr/python/bin/pip3.6 /usr/bin/pip
7..删除软连接
#rm -rf /usr/bin/pip
- pip
sudo python -m pip install pillow