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加密自己的密码
Aug 04 Python
详细解读Python中解析XML数据的方法
Oct 15 Python
Python自动化测试ConfigParser模块读写配置文件
Aug 15 Python
Flask框架的学习指南之用户登录管理
Nov 20 Python
Django 2.0版本的新特性抢先看!
Jan 05 Python
Python实现时钟显示效果思路详解
Apr 11 Python
Python实现购物评论文本情感分析操作【基于中文文本挖掘库snownlp】
Aug 07 Python
详解Python中打乱列表顺序random.shuffle()的使用方法
Nov 11 Python
Django中ORM找出内容不为空的数据实例
May 20 Python
Python函数递归调用实现原理实例解析
Aug 11 Python
pycharm debug 断点调试心得分享
Apr 16 Python
基于flask实现五子棋小游戏
May 25 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
php截取视频指定帧为图片
2016/05/16 PHP
基于php实现的php代码加密解密类完整实例
2016/10/12 PHP
Laravel5.1 框架数据库操作DB运行原生SQL的方法分析
2020/01/07 PHP
PHP isset empty函数相关面试题及解析
2020/12/11 PHP
JS localStorage实现本地缓存的方法
2013/06/22 Javascript
jQuery实现html元素拖拽
2015/07/21 Javascript
JS+CSS实现仿雅虎另类滑动门切换效果
2015/10/13 Javascript
javascript简单比较日期大小的方法
2016/01/05 Javascript
JS实现京东首页之页面顶部、Logo和搜索框功能
2017/01/12 Javascript
JavaScript脚本语言是什么_动力节点Java学院整理
2017/06/26 Javascript
AngularJS中table表格基本操作示例
2017/10/10 Javascript
mpvue中配置vuex并持久化到本地Storage图文教程解析
2018/03/15 Javascript
vue初始化动画加载的实例
2018/09/01 Javascript
详解Vue用cmd创建项目
2019/02/12 Javascript
javascript实现5秒倒计时并跳转功能
2019/06/20 Javascript
layer.open的自适应及居中及子页面标题的修改方法
2019/09/05 Javascript
vue动态渲染svg、添加点击事件的实现
2020/03/13 Javascript
JavaScript实现简单日历效果
2020/09/11 Javascript
Python中还原JavaScript的escape函数编码后字符串的方法
2014/08/22 Python
在win和Linux系统中python命令行运行的不同
2016/07/03 Python
详解python中 os._exit() 和 sys.exit(), exit(0)和exit(1) 的用法和区别
2017/06/23 Python
Python matplotlib 绘制双Y轴曲线图的示例代码
2020/06/12 Python
Python logging日志模块 配置文件方式
2020/07/12 Python
Django用内置方法实现简单搜索功能的方法
2020/12/18 Python
CSS3 倾斜的网页图片库实例教程
2009/11/14 HTML / CSS
纯CSS3大转盘抽奖示例代码(响应式、可配置)
2017/01/13 HTML / CSS
HTML5 对各个标签的定义与规定:body的介绍
2012/06/21 HTML / CSS
美国儿童服装、家具和玩具精品店:Maisonette
2019/11/24 全球购物
WebSphere 应用服务器都支持哪些认证
2013/12/26 面试题
函授本科毕业自我鉴定
2013/10/09 职场文书
大学学年自我鉴定
2013/10/28 职场文书
事假请假条范文
2014/04/11 职场文书
综合素质自我评价怎么写
2014/09/14 职场文书
多属性、多分类MySQL模式设计
2021/04/05 MySQL
有趣的二维码:使用MyQR和qrcode来制作二维码
2021/05/10 Python
python调试工具Birdseye的使用教程
2021/05/25 Python