如何 Python3 并将其添加到系统环境变量中,才能在终端中使用 Python3 命令。
时间: 2024-05-06 21:21:21 浏览: 12
可以按照以下步骤将Python3添加到系统环境变量中:
1. 在终端中输入以下命令来安装Python3:
```console
$ sudo apt-get install python3
```
2. 打开.bashrc文件:
```console
$ nano ~/.bashrc
```
3. 在文件的末尾添加以下内容:
```console
export PATH=/usr/bin/python3:$PATH
```
4. 保存并退出文件。
5. 让环境变量立即生效:
```console
$ source ~/.bashrc
```
现在你就可以在终端中使用python3命令来运行Python3了。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![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)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)