# 1.尝试安装pip
windows下的ubuntu linux安装pip,命令:sudo apt-get install python-pip,报错。
# 2.解决问题,重新安装pip。
使用命令sudo apt-get clean 或者sudo apt-get autoclean;然后 sudo apt-get -f install。
if Python2:
sudo apt-get install python-pip
if Python3:
sudo apt-get install python3-pip
这样就可以解决报错问题,在WSL下安装pip了。
#3.另一种方法:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip就安装完成了。
若安装有问题可参考pip官方下载地址的教程:https://pypi.org/project/pip/
PS:此脚本也可以用来给windows安装pip,安装完需要自己手动添加系统环境变量