Python pip 常用命令汇总


Posted in Python onOctober 19, 2020

使用了这么就pip命令,但是一直是简单使用,很多命令都是用了查,查了用,今天把常用的命令汇总一下,方便使用。

命令:

pip

Python pip 常用命令汇总

由上图可以看到 pip 支持一下命令

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.
 search           Search PyPI for packages.
 wheel            Build wheels from your requirements.
 hash            Compute hashes of package archives.
 completion         A helper command used for command completion.
 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>        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 15 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 as trusted, even though it does
               not have valid or any HTTPS.
 --cert <path>        Path to alternate CA bundle.
 --client-cert <path>    Path to SSL client certificate, a single file
               containing the private key and the certificate
               in PEM format.
 --cache-dir <dir>      Store the cache data in <dir>.
 --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.

1、install

pip install
You must give at least one requirement to install (see "pip help install")

Python pip 常用命令汇总

所以这里可以直接使用一下命令实现在线安装

pip install <包名> 或 pip install -r requirements.txt
通过使用== >= <= > <来指定版本,不写则安装最新版

requirements.txt内容格式为:

APScheduler==2.1.2
Django==1.5.4
MySQL-Connector-Python==2.0.1
MySQL-python==1.2.3
PIL==1.1.7
South==1.0.2
django-grappelli==2.6.3
django-pagination==1.0.7

安装本地安装包

pip install <目录>/<文件名> 或 pip install --use-wheel --no-index --find-links=wheelhouse/ <包名>

2、uninstall

卸载安装包

pip uninstall <包名> 或 pip uninstall -r requirements.txt

升级包

pip install -U <包名>

或:pip install <包名> --upgrade

升级pip

pip install -U pip

使用pip安装插件的时候报错:

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

升级命令: python -m pip install --upgrade pip

3、freeze

pip freeze,查看已经安装的包及版本信息。

Python pip 常用命令汇总

导出到指定文件中,如图,注意 “ > ”,文件名称随意。常见按第二种写法。

Python pip 常用命令汇总

4、list

Python pip 常用命令汇总

查询可升级的包

pip list -o

Python pip 常用命令汇总

5、show

显示包所在目录及信息

Python pip 常用命令汇总

6、search

搜索包

pip search <搜索关键字>

以上就是Python pip 常用命令汇总的详细内容,更多关于Python pip 常用命令的资料请关注三水点靠木其它相关文章!

Python 相关文章推荐
python通过ftplib登录到ftp服务器的方法
May 08 Python
一键搞定python连接mysql驱动有关问题(windows版本)
Apr 23 Python
Python中矩阵库Numpy基本操作详解
Nov 21 Python
基于python3 OpenCV3实现静态图片人脸识别
May 25 Python
pandas ix &amp;iloc &amp;loc的区别
Jan 10 Python
Python实现使用request模块下载图片demo示例
May 24 Python
利用Python实现Shp格式向GeoJSON的转换方法
Jul 09 Python
用openCV和Python 实现图片对比,并标识出不同点的方式
Dec 19 Python
pandas数据选取:df[] df.loc[] df.iloc[] df.ix[] df.at[] df.iat[]
Apr 24 Python
python如何实现递归转非递归
Feb 25 Python
python opencv人脸识别考勤系统的完整源码
Apr 26 Python
Python基础之元类详解
Apr 29 Python
Python环境使用OpenCV检测人脸实现教程
Oct 19 #Python
python Tornado框架的使用示例
Oct 19 #Python
python mock测试的示例
Oct 19 #Python
python 提高开发效率的5个小技巧
Oct 19 #Python
python 利用toapi库自动生成api
Oct 19 #Python
协程Python 中实现多任务耗资源最小的方式
Oct 19 #Python
python爬取音频下载的示例代码
Oct 19 #Python
You might like
php5.3中连接sqlserver2000的两种方法(com与ODBC)
2012/12/29 PHP
使用PHP强制下载PDF文件示例
2014/01/17 PHP
codeigniter教程之多文件上传使用示例
2014/02/11 PHP
ThinkPHP CURD方法之table方法详解
2014/06/18 PHP
详解cookie验证的php应用的一种SSO解决办法
2017/10/20 PHP
TP5(thinkPHP5)框架使用ajax实现与后台数据交互的方法小结
2020/02/10 PHP
js实现图片从左往右渐变切换效果的方法
2015/02/06 Javascript
JavaScript中闭包的详解
2017/04/01 Javascript
微信小程序实现多选删除列表数据功能示例
2019/01/15 Javascript
js判断密码强度的方法
2020/03/18 Javascript
Vue 实现可视化拖拽页面编辑器
2021/02/01 Vue.js
[01:35]2018完美盛典章节片——共竞
2018/12/17 DOTA
python中的sort方法使用详解
2014/07/25 Python
实例讲解Python中SocketServer模块处理网络请求的用法
2016/06/28 Python
python快速建立超简单的web服务器的实现方法
2018/02/17 Python
利用python实现汉字转拼音的2种方法
2019/08/12 Python
python基于pdfminer库提取pdf文字代码实例
2019/08/15 Python
Tensorflow中的dropout的使用方法
2020/03/13 Python
django使用JWT保存用户登录信息
2020/04/22 Python
python“静态”变量、实例变量与本地变量的声明示例
2020/11/13 Python
python遍历路径破解表单的示例
2020/11/21 Python
html5各种页面切换效果和模态对话框用法总结
2014/12/15 HTML / CSS
使用canvas对多图片拼合并导出图片的方法
2018/08/28 HTML / CSS
中国综合网上购物商城:苏宁易购
2016/08/09 全球购物
日本高端护肤品牌:Tatcha
2016/08/29 全球购物
《毛主席在花山》教学反思
2014/04/20 职场文书
语文高效课堂实施方案
2014/05/03 职场文书
环保倡议书400字
2014/05/15 职场文书
2014司机年终工作总结
2014/12/05 职场文书
2014年节能工作总结
2014/12/18 职场文书
党员公开承诺书2015
2015/01/21 职场文书
项目经理助理岗位职责
2015/04/13 职场文书
专项资金申请报告
2015/05/15 职场文书
清明节随笔
2015/08/15 职场文书
Spring this调用当前类方法无法拦截的示例代码
2022/03/20 Java/Android