Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >pip怎么卸载安装包_pip怎么卸载

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

作者头像
全栈程序员站长
发布于 2022-11-02 09:40:17
发布于 2022-11-02 09:40:17
29.6K00
代码可运行
举报
运行总次数:0
代码可运行

大家好,又见面了,我是你们的朋友全栈君。

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命令。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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软件包的信息。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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的软件包。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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命令使用相同的命令,如下所示。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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命令使用相同的命令,如下所示。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
django
pycups
PyGObject
PyJWT
pymacaroons
PyNaCl
pyRFC3339

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

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

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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选项跳过它,如下所示。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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软件包。 在此示例中,我们将删除当前用户的软件包。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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的软件包。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ 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/

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

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

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年10月19日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
python3 不小心 卸载了 pip,重装 pip 办法
2. 升级 pip 因目录或文件权限问题,卸载了旧版 pip 但是没装上新版 pip(Windows)
卓越笔记
2023/02/18
1.1K0
7b2美化-首页添加导航会员区块
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
小狐狸说事
2022/11/17
8380
灵动岛前端Ui
当用户收到信息后,iPhone 14 Pro显示屏上方的灵动岛可以展开显示信息。此外灵动岛还可以显示音乐播放、Siri等组件,让用户在首页直接完成各种功能控制和信息阅读。iPhone 14 Pro 拥有6.1英寸屏幕,还将推出6.7英寸的iPhone 14 Pro MAX [2]
天天Lotay
2022/12/27
9250
灵动岛前端Ui
如何在Windows上下载,安装或卸载PyCharm?「建议收藏」
PyCharm is a Python IDE that provides easiness to developed Python Application.PyCharm provides a lot of useful features like smart code completion, code inspection, on-the-fly error highlighting, quick-fixes, automated code refactoring, and rich navigation capabilities.
全栈程序员站长
2022/09/27
8920
如何在Windows上下载,安装或卸载PyCharm?「建议收藏」
pip、brew、apt-get区别和作用
Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令。
沈宥
2022/05/09
1.4K0
升级python2.7和安装pip,easy_install和setuptool
接下来一步最重要! 这样才能使这次升级真正生效!否则python命令还是原来的2.6.6版
老高的技术博客
2022/12/27
7870
Python - pip 常用命令
pip(Python Package Index)是一个以 Python 语言写成的软件包管理系統,使用 pip 可以非常方便的安装和管理 python 软件包
小菠萝测试笔记
2021/08/25
6070
光标有反转效果的侧边导航(附源代码)
这是一个侧边导航效果,这个展开的效果给人一种很柔和的感觉,展开后菜单内容依次显示,最后是增加了一个聚焦的圆跟随光标移动,当遇到菜单内容时会放大圆形并反转显示菜单文字,加深了对导航的交互,这里的反转色基于 mix-blend-mode: difference 实现。这个效果还有两个主题色切换,有兴趣的可以在线看效果。
半夜喝可乐
2024/10/10
1900
光标有反转效果的侧边导航(附源代码)
Python安装模块的几种方法
下载模块包,进行解压,进入模块文件夹,执行: python setup.py install
py3study
2020/01/08
13.3K0
《PyCon2018》系列一:Pipen
俗话说,工欲善其事,必先利其器。我们写代码也是如此。在Python开发过程中,如何管理Python运行环境、package依赖关系是每个开发者都绕不过去的问题。在PyCon2018上,Kenneth Reitz介绍的Pipenv,就是用来解决这类问题的大杀器。
py3study
2020/01/19
7370
Mac m1安装homebrew和pip3
主要有四个部分组成: brew、homebrew-core 、homebrew-cask、homebrew-bottles。
清菡
2022/03/30
6.5K0
Mac m1安装homebrew和pip3
python的几种常用安装包的方式
打开windows命令行,不需要输入“python”或输入”python3”,而是直接输入以下指令。我们默认系统环境变量已经按照安装位置设置好。 一般安装之后默认是已经安装好了pip,我们可以直接使用: 对于python2:
py3study
2020/01/08
9600
python的几种常用安装包的方式
Python 安装包setuptools
Python安装包的命令有的easy_install, setuptools, 也有pip,distribute
py3study
2020/01/08
3.6K0
美化 Emlog 的文章访问密码页面
一直也没有见过emlog原生的文章密码访问页面,所以不知道emlog的文章访问密码页面十分的简陋,看到孟坤大佬做了优化,所以转载给有需要的人。
幻影网络
2022/11/08
8170
美化 Emlog 的文章访问密码页面
PIP知识文档
此参数“--trusted-host”表示信任,如果上一个提示不受信任,就先使用这个添加网址信任
徐建国
2022/04/28
6950
原生JS实现软件卸载对话框(超有趣)
今天给大家分享一个特别有意思的软件卸载对话框,鼠标在整个对话框里移动时,中间的人脸会作出不同的变化,当鼠标悬停到“保留”按钮上时,人脸的表情会变得开心,当鼠标悬停到“卸载”按钮上面时,人脸的表情会变得不开心。
越陌度阡
2020/11/26
4.4K0
原生JS实现软件卸载对话框(超有趣)
再见pip & conda!管理Python依赖关系的更好的选择:Poetry
然而,随着项目的扩大,依赖关系的数量也在增加。这可能会使项目的环境难以重现,并且在仅仅依靠pip或conda进行依赖性管理时难以有效地维护它。
数据STUDIO
2023/09/04
3.2K0
再见pip & conda!管理Python依赖关系的更好的选择:Poetry
Python 之 pip安装 及 使用详解
  pip 是 Python 的包安装程序。其实,pip 就是 Python 标准库(The Python Standard Library)中的一个包,只是这个包比较特殊,用它可以来管理 Python 标准库(The Python Standard Library)中其他的包。pip 支持从 PyPI,版本控制,本地项目以及直接从分发文件进行安装。pip 是一个命令行程序。 安装 pip 后,会向系统添加一个 pip 命令,该命令可以从命令提示符运行。   目前,pip 是 The Python Packaging Authority (PyPA) 推荐的 Python 包管理工具!英文比较好的同学可以直接去官网参看其用户手册
全栈程序员站长
2022/07/01
2.3K0
Python 之 pip安装 及 使用详解
片刻网项目
也就是说在一个大的容器中,我们在写入一个容器(红色)作为存放绿色容器、蓝色容器、紫色容器 。那么实现起来就很简单了。
Dreamy.TZK
2020/04/09
9430
Python pip包管理
    在Python中, 安装第三方模块是通过 setuptools 这个工具完成的。 Python有两个封装了 setuptools的包管理工具: easy_install  和  pip , 目前官方推荐使用 pip。
py3study
2020/01/08
6340
Python pip包管理
相关推荐
python3 不小心 卸载了 pip,重装 pip 办法
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验