下载python
这里以安装python3.7.1为例:
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
编译和安装python
prefix是指定python安装的位置
代码语言:javascript复制cd Python-3.7.1
./configure --prefix=/home/work/envs/python3.7.1 && make && make install
设置软连接
代码语言:javascript复制ln -s /home/work/envs/python3.7.1/bin/python3 /usr/bin/python3.7.1
ln -s /home/work/envs/python3.7.1/bin/pip3 /usr/bin/pip3.7.1