centos安装python3.8 pip - (卸载+删除)

# ubuntu删除

sudo apt-get purge --auto-remove python3.6

# centos删除卸载pyhton3
rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps       
 
删除所有残余文件
whereis python3 |xargs rm -frv           
 
查看现有安装的python
whereis   python       

#安装python3.8

安装依赖

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel -y
800  yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel -y
  801  yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel -y
  802  yum install wget -y
  803  yum install libffi-devel -y 
  804  yum install software-properties-common -y

源码安装
  806  mkdir download
  812  tar zxvf Python-3.8.1.tgz 
  814  cd Python-3.8.1
  819  mkdir -p /usr/local/python3
  831  ./configure --prefix=/usr/local/python3
  832  make -j4 && make install -j4

  834  python3 -V
  835  # sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python3
  836  python3 -V
  837  ln -s /usr/local/python3/bin/python3 /usr/bin/python3
  838  python3 -V
# 安装pip
  843  tar -zxvf pip-9.0.1.tar.gz 
  844  cd pip-9.0.1/
  845  python3 setup.py install
  846  #  sudo ln -s /usr/local/python3/bin/pip /usr/bin/pip3
  847  ln -s /usr/local/python3/bin/pip /usr/bin/pip3
  848  pip3 -V
  849  pip3 install requests
  850  pip3 install --upgrade pip3
  851  pip3 install --upgrade pip
  852  pip3 install python3-venv
 

 

-------centos6.5安装   3.6吧-------------------

一  安装 3.5(成功)

yum install centos-release-scl  -y

yum install scl-utils-build  -y

yum info rh-python35

scl enable rh-python35 bash

可以用scl --list查看安装了那些软件

 

二 安装3.6(待议)

yum 源准备
1、更新一下yum:
sudo yum -y update
该 -y 标志用于提醒系统我们知道我们正在进行更改,免去终端提示我们要确认再继续

2、安装yum-utils 【一组扩展和补充yum的实用程序和插件】
sudo yum -y install yum-utils
3、安装CentOS开发工具 【用于允许您从源代码构建和编译软件】
sudo yum -y groupinstall development


安装Python3
1、安装EPEL:
sudo yum -y install epel-release
2、安装IUS软件源:
sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
3、安装Python3.6:
sudo yum -y install python36u
4、安装pip3:
sudo yum -y install python36u-pip

5、检查一下安装情况,分别执行命令查看:
python3.6 -V
pip3.6 -V

在 /usr/lib/目录下可以看到Python3.6的文件夹

添加软链接

使用python3去使用Python3.6:
ln -s /usr/bin/python3.6 /usr/bin/python3
复制代码pip3.6同理:
ln -s /usr/bin/pip3.6 /usr/bin/pip3

 

你可能感兴趣的:(python相关,flask)