python2与python3和pip

这个问题在知乎上已经有人回答,由于笔者使用知乎上的方法没有成功,于是将笔者自己使用成功的方法写于下方,方便来者查看: 
linux下 
如果没有pip则需要安装pip 
python2安装pip

sudo apt install python-pip
1
如果是python3,则如下:

sudo apt install python3-pip
1
此时python2和python3同时有pip, 
使用pip时如下: 
python2:

python2 -m pip install XXX
1
python3:

python3 -m pip install XXX

原文:https://blog.csdn.net/Mr_Cat123/article/details/79221012 
 

猜你喜欢

转载自blog.csdn.net/jane_6091/article/details/86293181
今日推荐