多个pip安装:我可以删除什么?

时间:2017-11-09 17:47:16

标签: python linux pip

我安装了多个pip,但我只用了两个(一个用于python2,另一个用于python3)。

user@pc:~$ pip# tab completion list
pip     pip2    pip2.7  pip3    pip3.5  
user@pc:~$ for i in {"pip","pip2","pip2.7","pip3","pip3.5"}; do $i --version; done;
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
pip 9.0.1 from /home/jaky/.local/lib/python2.7/site-packages (python 2.7)
pip 9.0.1 from /home/jaky/.local/lib/python2.7/site-packages (python 2.7)
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)

我怀疑他们可能是别名链接到同一个bin,因为如果我尝试删除{pip2,pip2.7} pip(s)想删除〜/ .local / lib / python2.7 / site- packages / pip,如果我尝试删除{pip,pip3,pip3.5} pip想要删除/usr/local/python3.5/dist-packages/pip。

然而,当我搜索它们时,我发现了不同的二进制文件:

user@pc:~$ ll /usr/local/bin | grep pip
-rwxr-xr-x  1 root root      205 Nov  9 17:56 pip*
-rwxr-xr-x  1 root root      204 Oct 10 20:49 pip2*
-rwxr-xr-x  1 root root      204 Oct 10 20:49 pip2.7*
-rwxr-xr-x  1 root root      205 Nov  9 17:56 pip3*
-rwxr-xr-x  1 root root      205 Nov  9 17:56 pip3.5*

1 个答案:

答案 0 :(得分:1)

删除所有

  

apt-get autoremove pip *

安装你想要的东西。