美文网首页系统性能优化python
Centos安装及配置Python3

Centos安装及配置Python3

作者: Anson_1f2a | 来源:发表于2021-09-15 10:41 被阅读0次
    1. 安装依赖
    [root@anson ~] yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc
    
    1. 下载压缩包
      3.7的版本最为稳定,所以下载了3.7.12
      https://www.python.org/downloads/source/

    2. 安装

    [root@anson ~]# tar xvf Python-3.7.12.tar.xz
    [root@anson ~]# mv Python-3.7.12 /usr/local/python-3.7.12
    [root@anson ~]# cd /usr/local/python-3.7.12/
    [root@anson python-3.7.12]# ./configure --prefix=/usr/local/sbin/python-3.7.12
    [root@anson python-3.7.12]# make && make install
    # 安装成功
    Installing collected packages: setuptools, pip
    Successfully installed pip-20.1.1 setuptools-47.1.0
    
    1. 配置环境
    [root@anson python-3.7.12]# ln -sv /usr/local/sbin/python-3.7.12/bin/python3 /usr/bin/python3
    [root@anson python-3.7.12]# python3 -V
    Python 3.7.12
    ‘/usr/bin/python3’ -> ‘/usr/local/sbin/python-3.7.12/bin/python3’
    [root@anson python-3.7.12]# ln -s /usr/local/sbin/python-3.7.12/bin/pip3 /usr/bin/pip3
    [root@anson python-3.7.12]# pip3 -V
    pip 20.1.1 from /usr/local/sbin/python-3.7.12/lib/python3.7/site-packages/pip (python 3.7)
    

    相关文章

      网友评论

        本文标题:Centos安装及配置Python3

        本文链接:https://www.haomeiwen.com/subject/opqhgltx.html