Linux安装Python3.7

发布时间:2019-09-18 07:38:40编辑:auto阅读(2027)

    0.下载安装包

    https://www.python.org/downloads/release/python-370/

    1.安装3.7之前要先安装一些依赖包

        sudo apt-get update
        sudo apt-get upgrade
        sudo apt-get dist-upgrade
        sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
        sudo apt-get install libncursesw5-dev libgdbm-dev libc6-dev
        sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
        sudo apt-get install libssl-dev openssl
        sudo apt-get install libffi-dev

    2.添加配置

    ./configure -prefix=/usr/local/python3.7 #配置安装目录

    3.编译源码

    sudo make

    4.执行安装

    sudo make install 

    5.修改默认Python

    ln -s /usr/local/python3.7/bin/python3.7  /usr/bin/python

    6.检测

    python -V

关键字