Install Python3 on Linux

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make zlib zlib-devel libffi-devel -y
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz

Unzip the installation package and cd into it

Compile and install

./configure --prefix=/usr/local/python3.7.4
make && make install

Put the Python execution program into /usr/bin/

ln -s /usr/local/python3.7.4/bin/python3.7 /usr/bin/python3.7.4

Install third-party libraries that the code depends on

Update pip

python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

Install dependent libraries

python3 -m pip install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple

Guess you like

Origin blog.csdn.net/xianyu120/article/details/111837144