檢查centos7上的python環(huán)境
# 在控制臺(tái)上執(zhí)行 python 命令,可以看到輸出的版本號(hào)
[root@VM_105_217_centos Python-3.6.2]# python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
安裝
安裝依賴(lài)包
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
下載python源碼葱峡,安裝
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
mkdir /usr/local/python3
tar -xvJf Python-3.6.2.tar.xz
cd Python-3.6.2
./configure --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
安裝開(kāi)發(fā)所需要的依賴(lài)包
pip3 install urllib3 Crypto pycrypto PyMySQL sqlalchemy