SuperCLine

Every Morning Tell Yourself That You Are Getting More And More Better!

Linux安装python


install dependenies

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 libffi-devel

download python

wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz

install python

mkdir -p /usr/local/python3
tar -zxvf Python-3.8.9.tgz
cd Python-3.8.9
./configure --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3

PATH Settings

# vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH
# source ~/.bash_profile

Success

python3 -V
pip3 -V