python 解释器的位置 解释器对应pip的位置

发布时间 2023-11-03 01:16:27作者: fangpinz

python解释器的位置:

calix@calix-Precision-5820-Tower:~/fzhu$ which python3
/usr/bin/python3
calix@calix-Precision-5820-Tower:~/fzhu$ python3
Python 3.9.5 (default, Nov 18 2021, 16:00:48)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
/usr/bin/python3
>>>

whereis   which命令的使用, 需要要设置python解释器的目录路径到PATH环境变量中.

C:\Users\fzhu>where python
C:\fzhu\Python-3.10.4\python.exe
C:\Users\fzhu\AppData\Local\Microsoft\WindowsApps\python.exe

C:\Users\fzhu>python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
C:\fzhu\Python-3.10.4\python.exe
>>>

where命令的使用,需要设置系统环境变量Path中增加python解释器所在的目录.