代码语言:javascript复制
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make zlib zlib-devel libffi-devel -y
代码语言:javascript复制wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
解压安装包,并cd进去
编译并安装
代码语言:javascript复制./configure --prefix=/usr/local/python3.7.4
make && make install
将Python执行程序放入/usr/bin/中
代码语言:javascript复制ln -s /usr/local/python3.7.4/bin/python3.7 /usr/bin/python3.7.4
安装代码依赖的第三方库
更新pip
代码语言:javascript复制python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
安装依赖的库
代码语言:javascript复制python3 -m pip install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple