CentOS7.2安装python3.8与pip

1.安装第三方库

#  yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

#  yum install libffi-devel -y

2.安装python3

#  建立新目录
#  sudo mkdir /usr/local/python3 

#  以3.6.2为例,需要下载高版本请访问:https://www.python.org/ftp/python
#  wget --no-check-certificate https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz 

#  解压安装包
#  tar xzvf Python-3.6.2.tgz

#  cd Python-3.6.2

#  编译安装
#  sudo ./conigure --prefix=/usr/local/python3
#  sudo make
#  sudo make install

3.创建软链接

# sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python3

4.验证python安装

#  python3 -V

5.安装pip

#   wget --no-check-certificate https://github.com/pypa/pip/archive/9.0.1.tar.gz

6.解压安装

# tar -xzvf 9.0.1.tar.gz
# cd pip-9 .0.1
# python3 setup.py install

7.创建软链接

#  sudo ln -s /usr/local/python3/bin/pip /usr/bin/pip3

8.测试安装

# pip3 -V

 

你可能感兴趣的:(python3)