编译安装
# dependence
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel ncurses-devel xz-devel tk-devel -y
# source code
wget "https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz"
# tar
tar xf Python-3.6.3.tgz
cd Python-3.6.3/
# compile and install
./configure --prefix=/opt/python36 --enable-optimizations
make && make install
创建虚拟环境
/opt/python36/bin/python3 -m venv venv
source venv/bin/activate
(venv) python -V
Python 3.6.3
(venv) pip list --format=columns
Package Version
--------------- -------
numpy 1.13.3
pandas 0.21.0
pip 9.0.1
pyodbc 4.0.21
pypyodbc 1.3.4
python-dateutil 2.6.1
pytz 2017.3
setuptools 28.8.0
six 1.11.0