Linux安装Python3.7

2020-01-06 16:16:17 浏览数 (1)

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

0 人点赞