linux下非root用户安装python
python 2.7.15 安装
参考:https://blog.csdn.net/u012071918/article/details/78817344
1.安装python
下载python 2.7.15 : wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
解压文件: tar -zxvf Python-2.7.15.tgz
进入目录:cd Python-2.7.15
编译安装:
./configure --prefix=/home/***/software/python-2.7.15 //--prefix 指定要安装的目录
make
make install
配置环境变量
vim ~/.bashrc
加入:export PATH=~/software/python-2.7.15/bin:$PATH
source ~/.bashrc
输入python,出现Python 2.7.15 说明配置成功
2.安装setuptools ,这个主要为安装pip作准备的。
wget
-
-
no
-
check
-
certificate https:
/
/
pypi.python.org
/
packages
/
source
/
s
/
setuptools
/
setuptools
-
38.3.0
.zip
unzip setuptools
-
38.3.0
.zip
cd setuptools
-
38.3.0
python setup.py install
3.安装pip
wget
-
-
no
-
check
-
certificate https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz
tar -zxvf pip-18.0.tar.gz
cd pip-18.0.
python setup.py install