“找不到pip命令”错误解决方案Pip和Pip3对于Linux,Debian,Ubuntu,CentOS,Mint

Linux and opensource world mainly use package management software for installing, updating, and removing software. Python is using pip or pip3 for Python package management. pip is Python2 package manager where pip3 is Python3 package manager.

Linux和开源世界主要使用软件包管理软件来安装,更新和删除软件。 Python使用pippip3进行Python软件包管理。 pip是Python2软件包管理器,其中pip3是Python3软件包管理器。

“找不到pip命令”问题 (“pip command not found” Problem)

Command “pip” is used to manage python packages and can be executed from the bash shell like below. We will get an error like pip command not found when we try to run pip  or pip3 like below.

命令“ pip”用于管理python软件包,可以从bash shell执行,如下所示。 当我们尝试运行如下所示的pippip3时,将收到pip command not found类似pip command not found的错误。

$ pip search django
"pip command not found" Problem for Python2
“pip command not found” Problem for Python2
Python2的“找不到pip命令”问题

We can see from the screenshot that “pip” command is not executed and a message like “Command ‘pip3’ not found, but can be installed with: sudo apt install python-pip” is printed to the bash.

从屏幕截图中我们可以看到,“ pip”命令未执行,并且消息显示为“找不到命令'pip3',但可以通过以下命令安装:sudo apt install python-pip”。

$ pip3 search django
"pip command not found" Problem for Python3
“pip command not found” Problem for Python3
Python3的“找不到pip命令”问题

We can see from the screenshot that “pip3” command is not executed and a message like “Command ‘pip3’ not found, but can be installed with: sudo apt install python3-pip” is printed to the bash.

从屏幕截图中我们可以看到,“ pip3”命令未执行,并且消息显示为“找不到命令'pip3',但可以使用以下命令安装:sudo apt install python3-pip”。

在Ubuntu,Debian,Mint,Kali中为Python2安装pip软件包 (Install pip Package For Python2 In Ubuntu, Debian, Mint, Kali)

We will install Python2 pip package for deb based distributions like be Ubuntu, Debian, Mint and Kali. We can use this command for other deb based distributions as well.

我们将安装Python2 PIP封装deb基于分布等的Ubuntu,Debian的,薄荷和卡利。 我们也可以将该命令用于其他基于deb的发行版。

$ sudo apt install python-pip
Install pip Package For Python2 In Ubuntu, Debian, Mint, Kali
Install pip Package For Python2 In Ubuntu, Debian, Mint, Kali
在Ubuntu,Debian,Mint,Kali中为Python2安装pip软件包

在CentOS,RHEL,Fedora中为Python2安装pip软件包(Install pip Package For Python2 In CentOS, RHEL, Fedora)

We will install Python2 pip package for rpm based distributions like Fedora, CentOS, RHEL. We will install with the following command.

我们将为基于rpm的发行版(如Fedora,CentOS,RHEL)安装Python2 pip软件包。 我们将使用以下命令进行安装。

$ sudo yum install python2-pip
Install pip Package For Python2 In CentOS, RHEL, Fedora
Install pip Package For Python2 In CentOS, RHEL, Fedora
在CentOS,RHEL,Fedora中为Python2安装pip软件包

在Ubuntu,Debian,Mint,Kali中为Python3安装pip3软件包(Install pip3 Package For Python3 In Ubuntu, Debian, Mint, Kali)

We will install Python3 pip package for deb based distributions like be Ubuntu, Debian, Mint and Kali. We can use this command for other deb based distributions as well.

我们将安装Python3 PIP封装deb基于分布等的Ubuntu,Debian的,薄荷和卡利。 我们也可以将该命令用于其他基于deb的发行版。

$ sudo apt install python3-pip

在CentOS,RHEL,Fedora中为Python2安装pip软件包 (Install pip Package For Python2 In CentOS, RHEL, Fedora)

We will install Python3 pip package for rpm based distributions like Fedora, CentOS, RHEL. We will install with the following command.

我们将为基于rpm的发行版(如Fedora,CentOS,RHEL)安装Python3 pip软件包。 我们将使用以下命令进行安装。

$ sudo yum install python3-pip

使用easy_install安装 (Install with easy_install)

We can also use Python provided installation tool named easy_install . We will run the following command. But easy_install is provided by python-setuptools

我们还可以使用Python提供的名为easy_install安装工具。 我们将运行以下命令。 但是easy_installpython-setuptools

$ sudo easy_install pip

OR

要么

$ sudo easy_install pip3

为MacOSX安装Pip (Install Pip For MacOSX)

MacOSX provides similar features to the Linux distributions. Pip also provided for the MacOSX operating system. We can install the pip command with following “brew” command.

MacOSX提供与Linux发行版相似的功能。 还为MacOSX操作系统提供了Pip。 我们可以使用以下“ brew”命令安装pip命令。

$ brew install python

打印Pip2和Pip3版本 (Print Pip2 and Pip3 Version)

After installation we may need to get version information about the pip or pip3 or pip2 . We can use --version option to print detailed version and site-packages path.

安装后,我们可能需要获取有关pippip3pip2版本信息。 我们可以使用--version选项来打印详细的版本和site-packages路径。

$ pip --version
Print Pip2 and Pip3 Version
Print Pip2 and Pip3 Version
打印Pip2和Pip3版本
LEARN MORE  What Is Python (Programming Language and Features)?
了解更多什么是Python(编程语言和功能)?

翻译自: https://www.poftut.com/pip-command-not-found-error-solution-for-linux-debianubuntu-centos-mint/

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值