ubuntu安装py3.5
时间: 2023-11-30 18:42:18 浏览: 35
以下是在Ubuntu上安装Python 3.5的步骤:
1.更新软件包列表:
```
sudo apt-get update
```
2.安装依赖项:
```
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
```
3.下载Python 3.5源代码:
```
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
```
4.解压源代码:
```
tar -xvf Python-3.5.0.tgz
```
5.进入解压后的目录:
```
cd Python-3.5.0
```
6.配置安装选项:
```
./configure --enable-optimizations
```
7.编译并安装:
```
make -j8
sudo make altinstall
```
8.检查Python版本:
```
python3.5 -V
```
9.如果需要将Python 3.5设置为默认版本,可以使用以下命令:
```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.5 1
sudo update-alternatives --config python3
```
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)