在 windows cmd 中,输入 where pip
,会显示所有 pip.exe
所在路径。如下所示,第一个路径为 Python27
,此时执行 pip install xxx
会将包安装在 Python27\Lib\site-packages
目录下。pip3
也是类似,pip3 install xxx
会默认将包安装在 where pip3
第一个出现的路径上。
>> where pip
C:\Users\linky\AppData\Local\Programs\Python\Python27\Scripts\pip.exe
C:\Users\linky\AppData\Local\Programs\Python\Python36\Scripts\pip.exe
C:\Users\linky\Anaconda3\Scripts\pip.exe
>> where pip3
C:\Users\linky\AppData\Local\Programs\Python\Python36\Scripts\pip.exe