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

查看:61
本文介绍了无法找到包 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 而不是 python 3.我尝试使用以下命令下载 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 存储库:

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.启用存储库后,以 sudo 用户身份使用 python2 运行脚本以安装 pip :

sudo python2 get-pip.py

如果发生错误,作为回退,可以使用特定的 2.7 版本的 get-pip.py:

If an error occurs, as a fallback, the specific 2.7 version of get-pip.py can be used:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output 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天全站免登陆