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
29K00
代码可运行
举报
运行总次数: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 删除。

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

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
如何在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
8720
如何在Windows上下载,安装或卸载PyCharm?「建议收藏」
如何在Linux中设置Java主目录路径?
Java is a popular programming language and framework in the IT industry. There are a lot of applications developed with Java. Java requires Java Development Kit to develop applications. Compiled java applications can run on systems those are installed Java Runtime Environment a.k.a JRE. We will look in this post on how to set and check JRE or JDK or Java Home Path.
用户7886150
2021/02/02
5.4K0
python3 不小心 卸载了 pip,重装 pip 办法
2. 升级 pip 因目录或文件权限问题,卸载了旧版 pip 但是没装上新版 pip(Windows)
卓越笔记
2023/02/18
1K0
如何卸载 python setup.py install 安装的包?
当我们半自动安装某些 python 包时,总是存在很多依赖关系的问题,而这些问题还是很难避免的,所以,当我们安装一个不确定的包的时候,最好提前收集一些相关资料,或者请教他人,同时最好把安装过程都记录下来。不然到时候想要卸载半天都卸不干净,即麻烦又白白浪费时间。
章鱼猫先生
2021/10/15
4.8K0
如何卸载 python setup.py install 安装的包?
python包安装及安装包制作
1. 单文件模块:直接把文件拷贝到$python_dir/lib  这是类库目录(可直接将单文件或单包放在这里)
py3study
2020/01/08
1.9K0
Python 安装包setuptools
Python安装包的命令有的easy_install, setuptools, 也有pip,distribute
py3study
2020/01/08
3.5K0
Python - pip 常用命令
pip(Python Package Index)是一个以 Python 语言写成的软件包管理系統,使用 pip 可以非常方便的安装和管理 python 软件包
小菠萝测试笔记
2021/08/25
5970
pip、brew、apt-get区别和作用
Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令。
沈宥
2022/05/09
1.3K0
python的几种常用安装包的方式
打开windows命令行,不需要输入“python”或输入”python3”,而是直接输入以下指令。我们默认系统环境变量已经按照安装位置设置好。 一般安装之后默认是已经安装好了pip,我们可以直接使用: 对于python2:
py3study
2020/01/08
9360
python的几种常用安装包的方式
原生JS实现软件卸载对话框(超有趣)
今天给大家分享一个特别有意思的软件卸载对话框,鼠标在整个对话框里移动时,中间的人脸会作出不同的变化,当鼠标悬停到“保留”按钮上时,人脸的表情会变得开心,当鼠标悬停到“卸载”按钮上面时,人脸的表情会变得不开心。
越陌度阡
2020/11/26
4.2K0
原生JS实现软件卸载对话框(超有趣)
PIP知识文档
此参数“--trusted-host”表示信任,如果上一个提示不受信任,就先使用这个添加网址信任
徐建国
2022/04/28
6640
《PyCon2018》系列一:Pipen
俗话说,工欲善其事,必先利其器。我们写代码也是如此。在Python开发过程中,如何管理Python运行环境、package依赖关系是每个开发者都绕不过去的问题。在PyCon2018上,Kenneth Reitz介绍的Pipenv,就是用来解决这类问题的大杀器。
py3study
2020/01/19
7220
Python安装模块的几种方法
下载模块包,进行解压,进入模块文件夹,执行: python setup.py install
py3study
2020/01/08
13.1K0
基于逻辑回归的利用欠采样处理类别不平衡的
这个信用卡欺诈数据集是从kaggle上下载的,网址(https://www.kaggle.com/mlg-ulb/creditcardfraud#creditcard.csv) 在这个网址里也有对数据集的详细介绍,从上面摘取一部分数据集介绍:数据集包含由欧洲持卡人于2013年9月使用信用卡进行交的数据。此数据集显示两天内发生的交易,其中284,807笔交易中有492笔被盗刷。数据集非常不平衡,正例(被盗刷)占所有交易的0.172%。它只包含作为PCA转换结果的数字输入变量,这是因为由于保密问题,我们无法提供有关数据的原始功能和更多背景信息。特征V1,V2,... V28是使用PCA获得的主要组件,没有用PCA转换的唯一特征是“时间”和“量”。特征'时间'包含数据集中每个刷卡时间和第一次刷卡时间之间经过的秒数。特征“金额”是交易金额,此特征可用于实例依赖的成本认知学习。特征'类'是响应变量,如果发生被盗刷,则取值1,否则为0。
py3study
2020/01/17
1K0
python使用pip卸载和安装库「建议收藏」
问题出在哪呢?细心的同学会问了。其实呢,pip虽然是python的自带工具,而且安装了python之后会自动安装上pip,但pip工具并不能在python中打开哦! 下面我们演示如何在命令行中退出python,之后打开pip:
全栈程序员站长
2022/11/02
1.6K0
Mac m1安装homebrew和pip3
主要有四个部分组成: brew、homebrew-core 、homebrew-cask、homebrew-bottles。
清菡
2022/03/30
6.3K0
Mac m1安装homebrew和pip3
美化 Emlog 的文章访问密码页面
一直也没有见过emlog原生的文章密码访问页面,所以不知道emlog的文章访问密码页面十分的简陋,看到孟坤大佬做了优化,所以转载给有需要的人。
幻影网络
2022/11/08
7840
美化 Emlog 的文章访问密码页面
如何在Ubuntu 20.04上安装Python Pip
Pip是用于安装Python软件包的工具。 使用pip,您可以从Python软件包索引库(PyPI)和其他软件包索引中搜索,下载和安装软件包。
用户5005176
2021/08/01
4.1K0
片刻网项目
也就是说在一个大的容器中,我们在写入一个容器(红色)作为存放绿色容器、蓝色容器、紫色容器 。那么实现起来就很简单了。
Dreamy.TZK
2020/04/09
9170
简洁的HTML5视频播放器UI特效开源库
近期在做一个项目时,遇到了播放视频的问题,找了很多插件和方法,今天介绍的这个是比较认为简洁和功能强大的开源库,可以任意修改播放格式。
用户5997198
2019/09/10
2.1K0
简洁的HTML5视频播放器UI特效开源库
相关推荐
如何在Windows上下载,安装或卸载PyCharm?「建议收藏」
更多 >
领券
💥开发者 MCP广场重磅上线!
精选全网热门MCP server,让你的AI更好用 🚀
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验