CentOS升级Python

  1. 安装前的准备

     yum install gcc-c++ make -y
    
  2. 安装Python-3.8.0

     wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
     tar -zxvf Python-3.8.0.tgz
     cd Python-3.8.0
     ./configure --prefix=/usr/local/python
     make
     make install
    
  3. 修改目录权限

     useradd www
     chown -R www:www /usr/local/python
    
  4. 为新安装的python设置软连接到环境变量可及的目录

     ln -s /usr/local/python/bin/python3 /usr/bin/python3
    
  5. 测试升级是否成功

     python3 -V
     python3 --version
    

results matching ""

    No results matching ""