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
用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
列出/显示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
使用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
.ue6353ce88552e6dbc1e8148a68b93656 , .ue6353ce88552e6dbc1e8148a68b93656 .postImageUrl , .ue6353ce88552e6dbc1e8148a68b93656 .centered-text-area { min-height: 80px; position: relative; } .ue6353ce88552e6dbc1e8148a68b93656 , .ue6353ce88552e6dbc1e8148a68b93656:hover , .ue6353ce88552e6dbc1e8148a68b93656:visited , .ue6353ce88552e6dbc1e8148a68b93656:active { border:0!important; } .ue6353ce88552e6dbc1e8148a68b93656 .clearfix:after { content: ""; display: table; clear: both; } .ue6353ce88552e6dbc1e8148a68b93656 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ue6353ce88552e6dbc1e8148a68b93656:active , .ue6353ce88552e6dbc1e8148a68b93656:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ue6353ce88552e6dbc1e8148a68b93656 .centered-text-area { width: 100%; position: relative; } .ue6353ce88552e6dbc1e8148a68b93656 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ue6353ce88552e6dbc1e8148a68b93656 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ue6353ce88552e6dbc1e8148a68b93656 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ue6353ce88552e6dbc1e8148a68b93656:hover .ctaButton { background-color: #E67E22!important; } .ue6353ce88552e6dbc1e8148a68b93656 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ue6353ce88552e6dbc1e8148a68b93656 .ue6353ce88552e6dbc1e8148a68b93656-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ue6353ce88552e6dbc1e8148a68b93656:after { content: ""; display: block; clear: both; }

LEARN MORE  How To Install Numpy For Linux?

.ue6353ce88552e6dbc1e8148a68b93656 , .ue6353ce88552e6dbc1e8148a68b93656 .postImageUrl , .ue6353ce88552e6dbc1e8148a68b93656 .centered-text-area { min-height: 80px; position: relative; } .ue6353ce88552e6dbc1e8148a68b93656 , .ue6353ce88552e6dbc1e8148a68b93656:hover , .ue6353ce88552e6dbc1e8148a68b93656:visited , .ue6353ce88552e6dbc1e8148a68b93656:active { border:0!important; } .ue6353ce88552e6dbc1e8148a68b93656 .clearfix:after { content: ""; display: table; clear: both; } .ue6353ce88552e6dbc1e8148a68b93656 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ue6353ce88552e6dbc1e8148a68b93656:active , .ue6353ce88552e6dbc1e8148a68b93656:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ue6353ce88552e6dbc1e8148a68b93656 .centered-text-area { width: 100%; position: relative; } .ue6353ce88552e6dbc1e8148a68b93656 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ue6353ce88552e6dbc1e8148a68b93656 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ue6353ce88552e6dbc1e8148a68b93656 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ue6353ce88552e6dbc1e8148a68b93656:hover .ctaButton { background-color: #E67E22!important; } .ue6353ce88552e6dbc1e8148a68b93656 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ue6353ce88552e6dbc1e8148a68b93656 .ue6353ce88552e6dbc1e8148a68b93656-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ue6353ce88552e6dbc1e8148a68b93656:after { content: ""; display: block; clear: both; }

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

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

如何使用Pip卸载软件包?相关推荐

  1. pip卸载模块/宏包(python)

    使用pip卸载模块 pip uninstall bagname

  2. Ubuntu命令行下安装,卸载软件包的过程

    一.Ubuntu中软件安装方法 1.APT方式 (1)普通安装:apt-get install softname1 softname2 -; (2)修复安装:apt-get -f install so ...

  3. 安装及管理程序(yum搭建本地源,了解rmp命令,查询卸载软件包,编译安装的过程)

    文章目录 安装及管理程序 前言 linux命令与应用程序的关系 典型应用程序的目录结构 常见的软件包封装类型 查询RPM软件包信息 rpm概述 RPM机制封装命令格式 查询RPM软件包信息 查询未安装 ...

  4. Ubuntu系统管理 ——使用dpkg安装、查看、卸载软件包

    文章目录 dpkg 安装软件包 dpkg 查看已安装软件包 dpkg 删除已安装软件包 dpkg 查看软件包的安装位置 对于Ubuntu来说,使用dpkg安装软件包是非常常用的一种操作.但是时间久了以 ...

  5. Linux学习-21-yum命令(查询、安装、升级和卸载软件包)和软件组管理

    7.9 Linux yum命令(查询.安装.升级和卸载软件包) yum 提供了查找.安装.删除某一个.一组甚至全部软件包的命令 yum 语法 yum [options] [command] [pack ...

  6. pip卸载指定文件夹的库

    要卸载指定文件夹中的库,可以使用pip卸载命令,并指定库的完整路径: pip uninstall -y -r/path/to/library 其中,"-y" 选项表示自动回答 &q ...

  7. pip卸载库对应所有依赖库的解决方案

      大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.现 ...

  8. linux yum卸载与安装软件包,Linux yum命令详解(查询、安装、升级和卸载软件包)...

    yum提供了查询.安装.升级和卸载软件包的命令,一一给大家介绍. 查询 査询yum源服务器上所有可安装的软件包列表 [root@localhost yum.repos.d]# yum list #查询 ...

  9. ubuntu 清除 卸载软件包

    ubuntu 清除 卸载软件包 说明:由于图形化界面方法(如Add/Remove- 和Synaptic Package Manageer)比较简单,所以这里主要总结在终端通过命令行方式进行的软件包安装 ...

  10. Linux软件包管理(安装、升级、卸载软件包,管理软件源)

    文章目录 Linux软件包分为二进制包和源码包 源码包 优点缺点 安装过程 二进制包 优点缺点 依赖性 安装方法 RPM RPM包获取方法 RPM包格式 RPM安装 RPM查询 RPM升级 RPM卸载 ...

最新文章

  1. 深入Java虚拟机读书笔记[10:20]
  2. hbuilder怎么设置网页的大小_大明:网页字体大小怎么调?教你方法一键搞定
  3. select2 属性标签整理
  4. java deque.pop_Java ArrayDeque pop()方法
  5. OpenCV图像处理篇之边缘检測算子
  6. Mysql数据库小结
  7. 平时多流汗,战时少流血
  8. Unable to get the project ile from the web server的解决方法
  9. 企业如何选择最佳的SSL
  10. 网页脚本基本java语法_JSP学习(一)JSP基础语法
  11. 基于javaweb+mysql的网上书店管理系统在线购书系统(前台、后台)
  12. web文件管理系统_实用开源项目,基于Web的文件管理系统——DocSys
  13. SOFA Weekly | Committer 聊天室、SOFAJRaft 本周发布、新手任务
  14. 联想服务器的主板型号怎么看,科技知识:联想主板型号怎么看
  15. 基于LORA SX1278的温度监控控制系统开发设计-软件方案基于时分复用TDMA
  16. 【SparkSQL笔记】SparkSQL的入门实践教程(一)
  17. android -- 蓝牙 bluetooth (一) 入门
  18. 使用软碟通(UltraISO)刻录Linux系统
  19. JAVA Scanner 类用法小结
  20. 汽车动力系统ECU固件逆向工程初探

热门文章

  1. Java服务器环境搭建(JDK+TOMCAT)
  2. UOS手动选择富士施乐打印机驱动
  3. TranslateAnimation 使用详解
  4. 自动化测试框架cucumber_10分钟学会 Cucumber+Watir 自动化测试框架
  5. 计算机常见故障及其原因
  6. 咪咕音乐客户端免费版
  7. 计算机术语中bit的中文含义是,在计算机术语中bit的中文含义是
  8. 首都师范 博弈论 5 4 2 Shapley值应用案例
  9. 代码检查技术Checkstyle与p3c调研
  10. 火狐浏览器装ie tab出现问题出现组件冲突,标题栏一直显示正在连接,附加组件打不开,解决