春眠不觉晓 Python Pip知多少

目录

查看pip版本号命令: pip -V(注意V要大写)或pip --version 

查看已经安装的包:pip list

升级pip命令: pip install -U pip

pip安装包命令:pip install

升级包:pip install --upgrad *** 

卸载包:pip uninstall ***

搜索包:pip search ***

显示安装包信息:pip show *** , pip show -f  ***会列出文件信息

下载安装包:pip download *** -d "文件路径"

 小技巧

 


查看pip版本号命令: pip -V(注意V要大写)或pip --version 

C:\Users\Administrator>pip -V
pip 19.0.3 from c:\program files\python37\lib\site-packages\pip (python 3.7)

查看已经安装的包:pip list

C:\Users\Administrator>pip list
Package          Version
---------------- ----------
beautifulsoup4   4.8.2
bs4              0.0.1
certifi          2019.11.28
chardet          3.0.4
cx-Oracle        7.3.0
Django           2.2.11

升级pip命令: pip install -U pip

pip安装包命令:pip install

  1. pip install ***               安装的是最新版本

  2. pip install ***==1.1.3   指定版本

  3. pip install '****>=1.1.3' 最小安装版本

升级包:pip install --upgrad *** 

卸载包:pip uninstall ***

搜索包:pip search ***

C:\Users\Administrator>pip search Django
django-bagou (0.1.0)              - Django Websocket for Django
django-maro (0.0.2)               - `django-maro` is utility for django.
django-umanage (1.1.1)            - Django user management app for django
django-mailwhimp (0.1)            - django-mailwhimp integrates mailchimp into Django
django-jackal (2.2.1)             - Boilerplate for Django and Django REST Framework
django-hooked (0.2.6)             - WebHooks for Django and Django Rest Framework.
django-six (1.0.4)                - Django-six —— Django Compatibility Library
django-ide (0.0.5)                - A Django app to develop Django apps
django-nadmin (0.1.0)             - django nadmin support django version 1.8 based on 
....

显示安装包信息:pip show *** , pip show -f  ***会列出文件信息

C:\Users\Administrator> pip show Django
Name: Django
Version: 2.2.11
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: https://www.djangoproject.com/
Author: Django Software Foundation
Author-email: foundation@djangoproject.com
License: BSD
Location: c:\program files\python37\lib\site-packages
Requires: pytz, sqlparse
Required-by:

下载安装包:pip download *** -d "文件路径"

在这里下Django下不来可以使用清华的地址进行跳转,命令改为 pip download -i https://pypi.tuna.tsinghua.edu.cn/simple *** -d "文件路径"

C:\Users\Administrator>pip download -i https://pypi.tuna.tsinghua.edu.cn/simple Django -d "C:\packs"
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting Django
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/12/68/8c125da33aaf0942add5095a7a2a8e064b3812d598e9fb5aca9957872d71/Django-3.0.4-py3-none-any.whl (7.5MB)
    100% |████████████████████████████████| 7.5MB 2.5MB/s
  Saved c:\packs\django-3.0.4-py3-none-any.whl
Collecting pytz (from Django)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl
  Saved c:\packs\pytz-2019.3-py2.py3-none-any.whl
Collecting sqlparse>=0.2.2 (from Django)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/85/ee/6e821932f413a5c4b76be9c5936e313e4fc626b33f16e027866e1d60f588/sqlparse-0.3.1-py2.py3-none-any.whl
  Saved c:\packs\sqlparse-0.3.1-py2.py3-none-any.whl
Collecting asgiref~=3.2 (from Django)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/68/00/25013f7310a56d17e1ab6fd885d5c1f216b7123b550d295c93f8e29d372a/asgiref-3.2.7-py2.py3-none-any.whl
  Saved c:\packs\asgiref-3.2.7-py2.py3-none-any.whl
Successfully downloaded Django pytz sqlparse asgiref

下载结果:

 

 小技巧

在install/download 后面加入 -i https://pypi.tuna.tsinghua.edu.cn/simple 这个是清华镜像站能够下载包并安装成功 具体使用清华大学开源软件镜像站

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple  Django==1.11.18

 

发布了19 篇原创文章 · 获赞 9 · 访问量 5460
App 阅读领勋章
微信扫码 下载APP
阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览