如何在linux下查看python的安装路径
时间: 2023-09-05 08:13:48 浏览: 192
在cmd中查看python的安装路径方法
可以使用以下命令来查看Python的安装路径:
1. 在终端中输入以下命令:
```
which python
```
该命令会输出Python的可执行文件路径,例如:
```
/usr/bin/python
```
2. 在终端中输入以下命令:
```
python -c "import sys; print(sys.executable)"
```
该命令会输出Python解释器的路径,例如:
```
/usr/bin/python
```
3. 在终端中输入以下命令:
```
whereis python
```
该命令会输出Python相关文件的路径,例如:
```
python: /usr/bin/python /usr/bin/python2.7 /usr/bin/python3.6 /usr/bin/python3.7 /usr/bin/python3.8 /usr/lib/python2.7 /usr/lib/python3.6 /usr/lib/python3.7 /usr/lib/python3.8 /etc/python2.7 /etc/python3.6 /etc/python3.7 /etc/python3.8 /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python3.7 /usr/local/lib/python3.8 /usr/include/python2.7 /usr/include/python3.6m /usr/include/python3.7m /usr/include/python3.8 /usr/share/python /usr/share/man/man1/python.1.gz
```
阅读全文