pip怎么卸载安装包_pip怎么卸载

pip怎么卸载安装包_pip怎么卸载PythonPipcommandprovidessearch,install,update,uninstallpackages.Wecanusepipcommandtouninstallpackageseasilyeventherearesomealternativeslikeeasy_install.PythonPip命令提供搜索,安装,更新,…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

Python Pip command provides search, install, update, uninstall packages. We can use pip command to uninstall packages easily even there are some alternatives like easy_install.

Python Pip命令提供搜索,安装,更新,卸载软件包。 即使有easy_install之类的替代方法,我们也可以使用pip命令轻松卸载软件包。

用Pip列出已经安装的Python软件包 (List Already Installed Python Packages with Pip)

Before uninstalling or removing Python packages with pip we will list already installed Python packages. We will use list command for pip like below.

在通过pip卸载或删除Python软件包之前,我们将列出已安装的Python软件包。 我们将如下所示对pip使用list命令。

$ pip list
List Already Installed Python Packages with Pip
List Already Installed Python Packages with Pip
用Pip列出已经安装的Python软件包

We can see that the following information is provided by listing installed packages.

通过列出已安装的软件包,我们可以看到以下信息。

  • `Package` column shows the package complete name

    “包裹”列显示包裹的完整名称

  • `Version` column shows the most recent version of the given package

    “版本”列显示了给定软件包的最新版本

列出/显示Python软件包信息,版本(List/Display Python Packages Information, Version)

We can also show a given package complete information with the show command which can be useful before uninstalling it. In this example, we will show information about the Python package named Django.

我们还可以使用show命令显示给定的软件包完整信息,这在卸载之前可能很有用。 在此示例中,我们将显示有关名为Django的Python软件包的信息。

$ pip show django
List/Display Python Packages Information, Version
List/Display Python Packages Information, Version
列出/显示Python软件包信息,版本

使用Pip,Pip2,Pip3卸载/删除Python软件包(Uninstall/Remove Python Package with Pip, Pip2, Pip3)

We can uninstall the package with the uninstall pip command. We will also provide the package name. In this example, we will uninstall the package named django.

我们可以使用uninstall pip命令来卸载软件包。 我们还将提供包裹名称。 在此示例中,我们将卸载名为django的软件包。

$ pip uninstall django
Uninstall/Remove Python Package with Pip
Uninstall/Remove Python Package with Pip
使用Pip卸载/删除Python软件包

We can see that the directories and files removed are listed and a confirmation is shown where we will input y in order to accept the removal. After the remove/uninstall completed we will be shown Successfully uninstalled Django-2.2.5

我们可以看到列出了删除的目录和文件,并显示了一个确认,我们将在其中输入y以接受删除。 删除/卸载完成后,我们将显示Successfully uninstalled Django-2.2.5

If we want to remove packages related to the Python2 we can use the same command for the pip2command like below.

如果我们想删除与Python2相关的软件包,我们可以对pip2命令使用相同的命令,如下所示。

$ pip2 uninstall django

If we want to remove packages related to the Python3 we can use the same command for the pip3command like below.

如果我们想删除与Python3相关的软件包,我们可以对pip3命令使用相同的命令,如下所示。

$ pip3 uninstall django

使用Pip卸载/删除具有要求的Python软件包 (Uninstall/Remove Python Package with Requirements with Pip)

Modern Python applications and projects provide the required files in order to list the package list which should be installed. We can use this requirement file in order to specify the packages we have to remove the requirement file. In this example, the requirement file contains the following content with the name of requirements.txt.

现代Python应用程序和项目提供了必需的文件,以便列出应安装的软件包列表。 我们可以使用此需求文件来指定必须删除需求文件的软件包。 在此示例中,需求文件包含以下内容,其名称为requirements.txt

django
pycups
PyGObject
PyJWT
pymacaroons
PyNaCl
pyRFC3339

AND we will remove this requirements.txt file content like below.

并且我们将删除此requirements.txt文件内容,如下所示。

$ pip uninstall requirements.txt

无需询问Pip即可卸载/删除Python软件包 (Uninstall/Remove Python Package Without Asking Confirmation with Pip)

By default the package uninstallation or removal requires a confirmation from the user. This is generally providing the y which is a short form of Yes to accept package uninstall. We can automatically accept the confirmation and skip it with the -y or --yes option like below.

默认情况下,软件包的卸载或删除需要用户的确认。 通常,这是提供y形式, Yes接受软件包卸载的缩写。 我们可以自动接受确认,并使用-y--yes选项跳过它,如下所示。

$ pip uninstall -y django

$ pip2 uninstall -y django

$ pip3 uninstall -y django

使用Pip卸载/删除特定用户的Python软件包 (Uninstall/Remove Python Package For Specific User with Pip)

pip Python packages may be installed for a specific user into the users home directory. So we can uninstall given python package for a specific user with the --user option by providing the user name. In this example, we will remove packages for the current user.

pip Python软件包可以为特定用户安装到用户的主目录中。 因此,我们可以使用--user选项通过提供用户名来卸载特定用户的给定python软件包。 在此示例中,我们将删除当前用户的软件包。

$ pip uninstall --user django

$ pip2 uninstall --user django

$ pip3 uninstall --user django

使用easy_install卸载/删除Python软件包 (Uninstall/Remove Python Package with easy_install)

We can also use the easy_install command in order to remove installed python packages. We will use -m option and provide the package name. In this example, we will remove the package named django with the easy_install command.

我们还可以使用easy_install命令来删除已安装的python软件包。 我们将使用-m选项并提供软件包名称。 在此示例中,我们将使用easy_install命令删除名为django的软件包。

$ easy_install -m django

LEARN MORE  How To Install Numpy For Linux?

了解更多如何为Linux安装Numpy?

翻译自: https://www.poftut.com/how-to-uninstall-a-package-with-pip/

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/180196.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • C语言开发MicroPython模块(添加module)

    C语言开发MicroPython模块(添加module)MicroPython 添加模块框架模式相对简单 只需要按照定义好的固定框架就可以添加模块 module 一 向固件里面添加 module1 1 编写 mymodule c 文件 在 ports esp32 文件夹下新建一个文件 mymodule c 文件内输入如下内容 include stdint h include stdio h include py obj h include py runtime h STATICmp obj tmp my test functio

    2025年6月3日
    0
  • idea设置java版本_手机安卓版本怎么升级

    idea设置java版本_手机安卓版本怎么升级一、背景即使我电脑安装的JDK版本是8,然而在idea运行中常常提示xxjdk1.5已过时之类的,why?明明是我装的JDK8啊二、解决鼠标点击file->setting,进入idea的设置页面settings,根据截图操作,懒得写了,最后点击ok然后,鼠标点击file->ProjectStructure…

    2022年9月23日
    0
  • Pandas个人操作练习(1)创建dataframe及插入列、行操作

    Pandas个人操作练习(1)创建dataframe及插入列、行操作使用pandas之前要导入包:importnumpyasnpimportpandasaspdimportrandom#其中有用到random函数,所以导入一、dataframe创建pandas.DataFrame(data=None,index=None,columns=None,dtype=None,copy=False)data:numpy…

    2022年4月27日
    94
  • 提高系统可用性的那些架构策略[通俗易懂]

    提高系统可用性的那些架构策略[通俗易懂]系统高可用面临的挑战有哪些?1.资源不可用在实际业务中,出现资源不可用的原因种类可能很多,有的概率很低,比如网线被挖断了,机房失火,地震等等导致网络不可用,有的概率相对来说很高比如服务器硬件资源不足,服务器故障等等。这些问题都可能会导致对应的资源不可用。2.资源不均衡由于系统架构设计的时候没有针对高并发和大流量进行可伸缩设计,导致无法应对并发很大的场景,出现系统瘫痪甚至崩溃。3.节点功能异常这种情况是最常见的,由于代码是人写的,bug和漏洞都是难免的,所以在实际业务中大概率会出现功能

    2022年7月13日
    28
  • PyCharm设置Python版本

    PyCharm设置Python版本PyCharm默认会使用虚拟的Python解释器,即使没有安装也能够运行Python代码,但有强迫症的程序员一定不能忍受Project中存在这么多的文件目录。设置Python版本File->Settings->Project->ProjectInterpreter,设置本地安装的Python解释器版本创建Python工程创建工程时,选择Existin…

    2022年5月8日
    75
  • C++实现超分辨率 RDN

    C++实现超分辨率 RDNRDN(由残差密集网络实现的图像超分辨率)在《RDN-TensorFlow-master》有一个3倍模型(也只有这一个了):rdn_5_3_64_x3这里用C++实现这个的3倍重建:流程图:密集残差块:这个残差块结构内部和前面的ESRGAN(前面的文章)中的密集残差块是一样的,只是外部有点不同。定义密集残差块:struct密集残差块//4个卷积层…

    2022年6月18日
    26

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号