centos7.9 安装python 3.10.12

  • 软件下载

    wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz
    
  • 升级openssl

    参见下方链接
    

    openssl升级

  • 必要依赖安装

    yum install -y ncurses-devel gdbm-devel xz-devel sqlite-devel tk-devel uuid-devel readline-devel bzip2-devel libffi-devel
    
  • 编译安装

    tar -zxvf Python-3.10.12.tgz
    cd Python-3.10.12
    ./configure  --prefix=/usr/local/python3.10.12 --with-openssl=/usr/local/openssl --enable-optimizations
    make && make install
    
  • 软链接

    ln -s /usr/local/python3.10.12/bin/python3 /usr/bin/python3
    ln -s /usr/local/python3.10.12/bin/pip3 /usr/bin/pip3
    

你可能感兴趣的:(python,python,linux,开发语言)