[python]极好的pip

一.pip

1.为什么要用pip?

pip 是 Python 包管理工具,该工具提供了对Python 包的查找、下载、安装、卸载的功能。可以用命令行直接实行对包的管理,非常方便。

2.pip的下载?

目前如果你在 python.org 下载最新版本的安装包,则是已经自带了该工具。
Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具。
或者可以在https://pypi.org/project/pip/中直接安装。

可以通过如下命令查看是否安装成功

pip --version
或
pip -V

在这里插入图片描述
pip更新到最新版本

pip install -U pip

3.带你看pip的帮助文档

输入 pip --help
在这里插入图片描述
Usage:
pip [options]

Commands:
1.安装包
install Install packages.

pip install SomePackage              # 最新版本
pip install SomePackage==1.0.4       # 指定版本
pip install 'SomePackage>=1.0.4'     # 最小版本

比如我要安装 Django。用以下的一条命令就可以,方便快捷。

pip install Django==1.7

(升级包)

pip install --upgrade SomePackage
或
pip install -U SomePackage

比如更新numpy
在这里插入图片描述

download
Download packages.
uninstall
Uninstall packages.
freeze
Output installed packages in requirements format.
列出已安装的包。
list
List installed packages.
在这里插入图片描述


显示有关已安装包的信息
show Show information about installed packages.
pip show numpy
Name: numpy
Version: 1.19.0
Summary: NumPy is the fundamental package for array computing with Python.(概要: NumPy 是用 Python 进行数组计算的基本包。)
Home-page: https://www.numpy.org(主页)
在这里插入图片描述
(作者)Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
(位置)Location: c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages
Requires:
(必须项)Required-by: matplotlib


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 to
WARNING, ERROR, and CRITICAL logging levels).
–log Path to a verbose appending log.
–proxy Specify a proxy in the form [user:passwd@]proxy.server:port.
–retries Maximum number of retries each connection should attempt (default 5 times).
–timeout Set the socket timeout (default 15 seconds).
–exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup,
(a)bort.
–trusted-host Mark this host or host:port pair as trusted, even though it does not have valid or any
HTTPS.
–cert Path to alternate CA bundle.
–client-cert Path to SSL client certificate, a single file containing the private key and the
certificate in PEM format.
–cache-dir

Store the cache data in .
–no-cache-dir Disable the cache.
–disable-pip-version-check
Don’t periodically check PyPI to determine whether a new version of pip is available for
download. Implied with --no-index.
–no-color Suppress colored output
–no-python-version-warning
Silence deprecation warnings for upcoming unsupported Pythons.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值