无法找到软件包python-pip Ubuntu 20.04 [英] Unable to locate package python-pip Ubuntu 20.04

查看:2128
本文介绍了无法找到软件包python-pip Ubuntu 20.04的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装mininet-wifi.下载后,我一直在使用以下命令来安装它:

I am trying to install mininet-wifi. After downloading it, I have been using the following command to install it:

    sudo util/install.sh -Wlnfv

但是,我不断收到错误消息:

However, I keep getting the error:

    E: Unable to locate package python-pip

我已经尝试过多次下载python-pip.我知道mininet-wifi使用的是python 2而不是python3.我试图使用以下命令下载python-pip:

I have tried multiple times to download python-pip. I know mininet-wifi utilizes python 2 instead of python 3. I have tried to download python-pip using the command:

    sudo apt-get install python-pip

但这会导致相同的错误:

But that leads to the same error:

    E: Unable to locate package python-pip

推荐答案

Python 2的Pip未包含在Ubuntu 20.04存储库中.
您需要使用get-pip.py脚本为Python 2安装pip.


1.首先启用Universe存储库:

Pip for Python 2 is not included in the Ubuntu 20.04 repositories.
You need to install pip for Python 2 using the get-pip.py script.


1. Start by enabling the universe repository:

sudo add-apt-repository universe

2.更新程序包索引并安装Python 2:

sudo apt update 
sudo apt install python2

3.使用curl下载get-pip.py脚本:

curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py

4.启用存储库后,使用python2以sudo用户身份运行脚本以安装pip:

sudo python2 get-pip.py



Pip将被全局安装.如果您只想为您的用户安装它,请运行不带sudo的命令.该脚本还将安装setuptools和wheel,使您可以安装源代码发行版



Pip will be installed globally. If you want to install it only for your user, run the command without sudo. The script will also install setuptools and wheel, which allow you to install source distributions

通过打印pip版本号来验证安装:

pip2 --version

输出将如下所示:

 pip 20.0.2 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

这篇关于无法找到软件包python-pip Ubuntu 20.04的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆