上篇文章配置了虚机基础环境,本篇文章介绍配置python开发环境
配置YUM源
使用国内yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-
Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
安装python
安装相关依赖
sudo yum -y install openssl-devel readline-devel unzip
编译安装python
下载python源码包
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
安装
tar -xzf Python-3.6.2.tgz
./configure --prefix=/usr/local/python36
make && make install
修改pip配置
sudo tee /etc/pip.conf <<EOF
[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
[list]
format=columns
EOF
安装vartualenv并初始化环境
初始化环境&#x