debian安装kali_如何在Debian,Ubuntu,Kali,Mint中安装Pip?

本文介绍了如何在基于dpkg和apt的系统(如Debian、Ubuntu、Kali和Mint)上安装Python的Pip。当系统中未找到pip命令时,可以使用相应命令安装pip2(针对Python2)或pip3(针对Python3)。此外,还展示了如何查看pip版本、获取帮助信息以及使用pip安装软件包。
摘要由CSDN通过智能技术生成
debian安装kali

debian安装kali

Pip is a python package manager. Python packages and libraries can be installed in different ways to the system. We can also use the distribution provided package manager to install Python libraries. Python packages can get from pypi.python.org . How can we install pip in Debian, Ubuntu, Kali, or similar dpkg, apt-based distributions.

Pip是python软件包管理器。 Python软件包和库可以以不同的方式安装到系统中。 我们还可以使用发行版提供的包管理器来安装Python库。 Python包可以从pypi.python.org获得。 我们如何在Debian,Ubuntu,Kali或类似的基于apt的dpkg发行版中安装pip。

“找不到命令'pip',但可以通过以下方式安装:”错误 (“Command ‘pip’ not found, but can be installed with:” Error)

If pip is not installed in the current system we will get an error like below.

如果当前系统中未安装pip ,则会出现如下错误。

"Command 'pip' not found, but can be installed with:" Error
“Command ‘pip’ not found, but can be installed with:” Error
“找不到命令'pip',但可以通过以下方式安装:”错误

We can see that the pip  can be installed with the following command. But keep in mind that this will install pip command for the Python version 2 or Python2. We can explicitly specify that we want to install pip3 or pip for Python 3.

我们可以看到可以使用以下命令安装pip 。 但是请记住,这将为Python版本2或Python2安装pip命令。 我们可以明确指定要为Python 3安装pip3或pip。

$ sudo apt install python-pip
Install Python2 Pip For Ubuntu, Debian, Mint, Kali
Install Python2 Pip For Ubuntu, Debian, Mint, Kali
为Ubuntu,Debian,Mint,Kali安装Python2 Pip

OR with the following command, we can install pip for Python3. As we can see that the package name for the Python3 Pip is python3-pip

或使用以下命令,我们可以为Python3安装pip。 如我们所见,Python3 Pip的软件包名称是python3-pip

$ sudo apt install python3-pip
Install Python3 Pip For Ubuntu, Debian, Mint, Kali
Install Python3 Pip For Ubuntu, Debian, Mint, Kali
为Ubuntu,Debian,Mint,Kali安装Python3 Pip

If we want to get more information about the Pip package for the Python3 before the installation we can list python3-pip package information with the apt shown command like below.

如果要在安装之前获取有关Python3的Pip软件包的更多信息,我们可以使用apt shown命令列出python3-pip软件包信息,如下所示。

$ apt show python3-pip
Python3 Pip Package and Version Information
Python3 Pip软件包和版本信息

We can see that this will list Python3 Pip package information like Package Name ,Pip Version which is 9.0.1. in this case. Section ,Source , Origin , Maintainer , Installed Size , Dependencies etc.

我们可以看到,它将列出Python3 Pip软件包信息,例如Package NamePip Version为9.0.1。 在这种情况下。 SectionSourceOriginMaintainerInstalled SizeDependencies

为Python2安装Pip2(Install Pip2 For Python2)

We assume that distribution default Python version 2. This makes the keyword by default Python2. So we can just use the following command.

我们假设该发行版默认为Python2。这使关键字默认为Python2。 这样我们就可以使用以下命令。

$ sudo apt-get install python-pip

显示Python2的Pip版本 (Show Pip Version For Python2)

As Python is a dynamic language and provides updates about libraries pip will also get updates. This will cause pip version to change. We can print the current version of the pip command with the --version option like below.

由于Python是一种动态语言,并且提供有关库的更新,因此pip也将获得更新。 这将导致pip版本更改。 我们可以使用--version选项打印当前版本的pip命令,如下所示。

$ pip -V
$ pip --version

OR

要么

$ pip3 -V
$ pip3 --version

OR

要么

$ pip2 -V
$ pip2 --version
Print Python Pip Version For Pip2 and Pip3
Print Python Pip Version For Pip2 and Pip3
打印Pip2和Pip3的Python Pip版本

打印点的帮助(Print Help For Pip)

More information and help about pip can be printed with the --help option like below.

可以使用--help选项打印有关pip更多信息和帮助,如下所示。

$ pip --help
Print Help For Pip 
Print Help For Pip
打印点的帮助

“找不到命令'pip3',但可以使用以下命令安装:”错误(“Command ‘pip3’ not found, but can be installed with:” Error)

If pip is not installed in the current system we will get an error like below.

如果当前系统中未安装pip ,则会出现如下错误。

"Command 'pip3' not found, but can be installed with:" Error
“Command ‘pip3’ not found, but can be installed with:” Error
“找不到命令'pip3',但可以使用以下命令安装:”错误

为Python3安装Pip3(Install Pip3 For Python3)

Pip3 is a package manager for specifically Python3. So Python2 and Python3 package managers are different. How can we install Pip3 into Ubuntu, Debian, Kali, or related dpkg or apt distros like below.

Pip3是专门用于Python3的软件包管理器。 因此,Python2和Python3包管理器是不同的。 我们如何将Pip3安装到如下所示的Ubuntu,Debian,Kali或相关的dpkg或apt发行版中。

$ sudo apt install python3-pip

显示适用于Python3的Pip3版本 (Show Pip3 Version For Python3)

Python3 is a dynamic language and provides updates about libraries pip3 will also get updates. This will cause pip3 version to change. We can print the current version of the pip3 command with the --version option like below.

Python3是一种动态语言,它提供有关库pip3更新也将获得更新。 这将导致pip3版本更改。 我们可以使用--version选项打印当前版本的pip3命令,如下所示。

$ pip3 --version
Show Pip3 Version For Python3
Show Pip3 Version For Python3
显示适用于Python3的Pip3版本

As we can see that the current version of Python is 3.6 and pip version is 9.0.1.

我们可以看到,当前的Python版本是3.6 ,pip版本是9.0.1

Pip3的打印帮助 (Print Help For Pip3)

We can print help information about the pip3 with the --help an option like below.

我们可以使用--help选项打印有关pip3帮助信息,如下所示。

$ pip3 --help
Print Help For Pip3
Print Help For Pip3
Pip3的打印帮助

We can see that the installed pip3 command provides the following options or commands.

我们可以看到,已安装的pip3命令提供了以下选项或命令。

  • install is used to install a Python or Pip Package

    install用于安装Python或Pip软件包

  • download is used to only download a Python or Pip Package

    download仅用于下载Python或Pip软件包

  • uninstall is used to uninstall or remove a Python or Pip Package

    uninstall用于卸载或删除Python或Pip程序包

  • list is used to list all installed a Python or Pip Package

    list用于列出所有已安装的Python或Pip软件包

  • show is used to show detailed information about a Python or Pip Package

    show用于显示有关Python或Pip包的详细信息

  • search is used to search a Python or Pip Package

    search用于搜索Python或Pip包

LEARN MORE  Python Standard Library
了解更多Python标准库

使用Pip For Python2安装软件包(Install Package with Pip For Python2 )

After installation of the pip package is complete we can install packages by using pip command. In this example, we will install the popular web framework named Django with pip command.

完成pip软件包的安装后,我们可以使用pip命令安装软件包。 在此示例中,我们将使用pip命令安装名为Django的流行Web框架。

$ pip install django

使用Pip3命令安装软件包(适用于Python3) (Install Package with Pip3 Command For Python3)

We can also install new packages with pip3 command we will install the Django package with pip3 command.

我们也可以使用pip3命令安装新软件包,我们将使用pip3命令安装Django软件包。

$ pip3 install django
Install Package with Pip From Python Repository
Install Django Python3 Package with pip3 Command
使用pip3命令安装Django Python3软件包
How to Install Pip in Debian, Ubuntu, Kali, Mint? Infografic
How to Install Pip in Debian, Ubuntu, Kali, Mint? Infografic
如何在Debian,Ubuntu,Kali,Mint中安装Pip? 信息移植

翻译自: https://www.poftut.com/how-to-install-pip-in-debian-ubuntu-kali/

debian安装kali

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值