CentOS7.7安装python3.8.2与pip20,,1.安装第三方库#


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  # 下载安装包#  wget --no-check-certificate https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz #  解压安装包#  tar xzvf Python-3.8.2.tgz #  cd Python-3.8.2 #  编译安装#  sudo ./configure --prefix=/usr/local/python3
#  sudo make 
#  sudo make install

3、修改系统的默认Python编译器

#  删除默认Python软连接#  rm /usr/bin/python       #  创建软链接                               # sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python

4.验证python安装

#  python -V

5.安装pip

#  /usr/bin/python -m pip install --upgrade pip

# 或者下载安装脚本# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py# 执行安装脚本# python get-pip.py

6、测试安装

# pip -V

CentOS7.7安装python3.8.2与pip20

评论关闭