树莓派python3.8安装
时间: 2023-10-14 17:15:33 浏览: 195
python3.8安装包
1. 首先更新系统,打开终端输入以下命令:
```
sudo apt-get update
sudo apt-get upgrade
```
2. 安装Python3.8所需的依赖库:
```
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev zlib1g-dev libsqlite3-dev tk-dev libssl-dev openssl libffi-dev python3-dev
```
3. 下载Python3.8:
```
cd ~
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
```
4. 解压Python3.8:
```
tar xvf Python-3.8.0.tgz
```
5. 编译安装Python3.8:
```
cd Python-3.8.0
./configure --enable-optimizations
make -j4
sudo make altinstall
```
6. 安装完毕后,检查是否安装成功:
```
python3.8 --version
```
输出Python3.8的版本信息即为安装成功。
7. (可选)设置Python3.8为默认版本:
```
sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 1
sudo update-alternatives --config python3
```
按照提示选择Python3.8即可。
阅读全文