linux安装python3.7清华园
时间: 2023-12-16 20:27:30 浏览: 189
Linux下Python3.7安装
以下是在Linux上安装Python3.7的步骤:
1. 首先,使用以下命令更新软件包列表:
```shell
sudo apt-get update
```
2. 接下来,安装Python3.7所需的依赖项:
```shell
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
```
3. 然后,从清华镜像站下载Python3.7的源代码包:
```shell
wget https://mirrors.tuna.tsinghua.edu.cn/python/3.7.0/Python-3.7.0.tgz
```
4. 解压缩下载的源代码包:
```shell
tar xzf Python-3.7.0.tgz
```
5. 进入解压缩后的目录,并执行以下命令进行编译和安装:
```shell
cd Python-3.7.0
./configure --enable-optimizations
make -j8
sudo make altinstall
```
6. 最后,检查Python3.7是否成功安装:
```shell
python3.7 --version
```
如果成功安装,将显示Python3.7的版本号。
阅读全文