pip

先来演示pip的错误打开方式:

C:\Users\86188>py
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> pip
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name 'pip' is not defined
>>>

问题出在哪呢?细心的同学会问了。其实呢,pip虽然是python的自带工具,而且安装了python之后会自动安装上pip,但pip工具并不能在python中打开哦!
下面我们演示如何在命令行中退出python,之后打开pip:

>>> exit()C:\Users\86188>pipUsage:pip <command> [options]Commands:install                     Install packages.download                    Download packages.uninstall                   Uninstall packages.freeze                      Output installed packages in requirements format.list                        List installed packages.show                        Show information about installed packages.check                       Verify installed packages have compatible dependencies.config                      Manage local and global configuration.search                      Search PyPI for packages.cache                       Inspect and manage pip's wheel cache.wheel                       Build wheels from your requirements.hash                        Compute hashes of package archives.completion                  A helper command used for command completion.debug                       Show information useful for debugging.help                        Show help for commands.General Options:-h, --help                  Show help.--isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.-v, --verbose               Give more output. Option is additive, and can be used up to 3 times.-V, --version               Show version and exit.-q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding toWARNING, ERROR, and CRITICAL logging levels).--log <path>                Path to a verbose appending log.--proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.--retries <retries>         Maximum number of retries each connection should attempt (default 5 times).--timeout <sec>             Set the socket timeout (default 6000.0 seconds).--exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup,(a)bort.--trusted-host <hostname>   Mark this host or host:port pair as trusted, even though it does not have valid or anyHTTPS.--cert <path>               Path to alternate CA bundle.--client-cert <path>        Path to SSL client certificate, a single file containing the private key and thecertificate in PEM format.--cache-dir <dir>           Store the cache data in <dir>.--no-cache-dir              Disable the cache.--disable-pip-version-checkDon't periodically check PyPI to determine whether a new version of pip is available fordownload. Implied with --no-index.--no-color                  Suppress colored output--no-python-version-warningSilence deprecation warnings for upcoming unsupported Pythons.C:\Users\86188>

先输入exit(),回车,我们就从python的界面退出了。
接着输入pip回车,就出现了长达一整页的提示,其中包括了install、uninstall等,都是可以使用pip完成的功能。
那么我们来用pip卸载一个库吧!首先,以绘图工具pandas为例来试一试:

C:\Users\86188>pip uninstall pandas
Found existing installation: pandas 1.0.5
Uninstalling pandas-1.0.5:Would remove:c:\users\86188\appdata\local\programs\python\python38-32\lib\site-packages\pandas-1.0.5.dist-info\*c:\users\86188\appdata\local\programs\python\python38-32\lib\site-packages\pandas\*
Proceed (y/n)?

输入pip uninstall pandas,会看到命令行出现以上反应,并且会有一个”继续(是/否)的提示,此时如果我们输入y并按回车,卸载进程就会继续,如果我们输入n并按回车,卸载过程就会停止。
我输入了y和回车,结果如下:

 Proceed (y/n)? ySuccessfully uninstalled pandas-1.0.5

接下来我们再来安装,输入“pip install pandas",可以看到如下界面:

C:\Users\86188>pip install pandas
Looking in indexes: http://pypi.douban.com/simple
Collecting pandasDownloading http://pypi.doubanio.com/packages/0d/3b/c306fc4c669f9208ba5a62d29a71fcb5df3be80a914da9e7b30ad682589f/pandas-1.0.5-cp38-cp38-win32.whl (7.6 MB)|████████████████████████████████| 7.6 MB 1.3 MB/s
Requirement already satisfied: numpy>=1.13.3 in c:\users\86188\appdata\local\programs\python\python38-32\lib\site-packages (from pandas) (1.19.0)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\86188\appdata\roaming\python\python38\site-packages (from pandas) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in c:\users\86188\appdata\local\programs\python\python38-32\lib\site-packages (from pandas) (2020.1)
Requirement already satisfied: six>=1.5 in c:\users\86188\appdata\roaming\python\python38\site-packages (from python-dateutil>=2.6.1->pandas) (1.14.0)
Installing collected packages: pandas
Successfully installed pandas-1.0.5

此时需要联网,进度条是下载的进度,Successfully installed pandas-1.0.5是”成功安装pandas-1.0.5版本“的意思。

python使用pip卸载和安装库相关推荐

  1. python 之 pip、pypdf2 安装与卸载

    pip是个啥? pip 是一个现代的,通用的 Python 包管理工具.提供了对 Python 包的查找.下载.安装.卸载的功能. 第一步:pip 下载:https://pypi.org/projec ...

  2. 彻底删除linux的python和pip,linux下安装python和pip

    注意:不要轻易去卸载原有的python环境,因为有些软件是依赖他的 一:安装前,先将依赖环境一并安装,避免后面重复编译 [root@redhat2 bin]# yum install gcc g++ ...

  3. 修改conda环境和缓存默认路径/修改Python 的 pip install 默认安装依赖路径

    文章目录 一. 默认安装路径 1.在本地环境下 2.在虚拟环境下 二.修改安装路径 问题: 解决: 1.在本地环境下 (1)使用 setup.py安装 (2)使用 whl格式文件安装 (3)使用 pi ...

  4. anconda 下的pip路径_修改conda环境和缓存默认路径/修改Python 的 pip install 默认安装依赖路径/提高conda安装速度,其实就是改了下载源。...

    1, 如果anaconda装在了C盘,可能conda 的默认环境和缓存默认路径就会在C盘中,可用:conda info命令来看. conda环境和缓存的默认路径(envs directories 和 ...

  5. 【强迫症系列】【win】更改 Python 的 pip install 默认安装依赖路径

    前言 声明:python版本3.6,以下讨论的Python也都是适用于3.x版本 在实际使用安装python的pip安装 依赖库是非常的便捷的. 而且一般大家使用的都是安装Anaconda 来学习和实 ...

  6. Python轻松入门——anaconda如何安装库+万能安装

    0.在开始菜单中找到anaconda安装文件 1.选中 anaconda navigator (如果打不开,可以重新安装 anaconda,清空该文件,然后重新安装就好) (打开过程比较漫长,等待打开 ...

  7. python找不到第三方安装库

    在命令行下输入python; >>>import sys >>>sys.path 可以列示出python导入库的查找路径:D:\\Program Files\\Py ...

  8. Python 命令pip install pygame安装报错

    报错1如下: Traceback (most recent call last):File "c:\users\administrator\appdata\local\programs\py ...

  9. python 学习(pip工具的安装)

    mac 电脑上使用终端命令 curl https://bootstrap.pypa.io/get-pip.py | python3 基于Python 3 pip --version pip3 list ...

  10. Python之pip源码安装三方库

    当本地linux服务器无法连接外网时,可以通过源码安装的方式安装三方库 1 创建存放库压缩包的目录 mkdir python 2 进入到目录下载所需要的库(以openpyxl为例) cd python ...

最新文章

  1. 报Java面授班有哪些优势
  2. 常用的stsadm命令行参数
  3. 如何动态调用WebServices
  4. AlertDialog(对话框)的基本使用
  5. 吴恩达 coursera ML 第八课总结+作业答案
  6. linux 权限777_Linux编程之权限系统与工具使用(二)
  7. 使用Scalatra创建Scala WEB工程
  8. 团队管理(3)---如何成为一名优秀的管理者
  9. html5白话解释,HTML5这个词到底是什么意思?
  10. 浅谈Flutter UI布局
  11. 组件cdn引入_高性能 React UI组件库SHINEOUT
  12. 智钜科技解读:单轨,双轨,多轨,三三复制的区别
  13. 查看计算机显卡驱动版本,电脑怎么更新显卡驱动?如何查看驱动是否正常
  14. 学做‘视频剪辑’攻略
  15. 全能----达芬奇之工艺交叉学
  16. 研究背景与文献综述的区别是什么?
  17. hdu 4699 模拟栈
  18. java创建临时文件夹_Java 创建文件、文件夹以及临时文件
  19. Python的scrapy之爬取6毛小说网
  20. 计算几何(圆相关模板) - 2D Geometry 110 in 1! - UVA 12304

热门文章

  1. [张国荣][21CD][1998-2002][APE+CUE][8.00G][115][sqhhj0622#HD2PT]
  2. win7激活一万遍都没解决的同学请看过来
  3. 通达OA11.0 补丁文件
  4. 三款 Mac 远程控制(远程桌面)工具
  5. UE编辑器加入鼠标右键
  6. 概率论与随机过程难题整理复习
  7. office和flash计算机课程,Powerpoint和Flash制作教学课件技巧
  8. Linux C语言写的超级简单端口扫描器
  9. Android 视频缩放/放大
  10. 计算机毕业设计之会议预约系统设计与实现