CentOs源码安装python3.6

  Python

额外安装包

需要libffi,否则make install 会报错

yum -y install libffi
apt-get install libffi-dev

编译安装方式

./configure --with-ssl --enable-ipv6 --prefix=/usr/local/python36 --enable-shared  --enable-loadable-sqlite-extensions && make && make install 

安装虚拟环境模块virtualenv

/usr/local/python36/bin/pip3.6 install virtualenv

不全局使用所以不加软连接,只添加virtualenv的软连接

ln -s /usr/local/python36/bin/virtualenv /usr/local/bin/virtualenv36

安装虚拟环境模块pipenv

/usr/local/python36/bin/pip3.6 install pipenv

pipenv的使用见:Python虚拟环境的使用