1
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel mysql-devel gcc gcc-devel python-devel // 安装相关依赖库
wget "https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz"
tar -zxvf Python-3.5.0.tgz
mkdir /usr/local/python3
yum install gcc(有时候需要)
Python-3.5.0/configure --prefix=/usr/local/python3
//cd Python-3.5.0
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
安装pip3 和 virtualenv
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
pip install virtualenv
ln -s /usr/local/python3/bin/virtualenv /usr/bin/virtualenv
virutalenv -p /usr/bin/python3 虚拟环境目录
cd 虚拟环境目录
source ./bin/activate
pip3 使用豆瓣源
或者直接使用 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple decouple xxx(模块名称)