【python】linux下安装python的一般方法
下载python
网址:https://mirrors.huaweicloud.com/python/
这里以安装python3.7.1为例:
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
编译和安装python
prefix是指定python安装的位置
cd Python-3.7.1
./configure --prefix=/home/work/envs/python3.7.1 && make && make install
设置软连接
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