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中lambda函数 list comprehension 和 zip函数使用指南
Sep 28 Python
Python常用的文件及文件路径、目录操作方法汇总介绍
May 21 Python
读取本地json文件,解析json(实例讲解)
Dec 06 Python
Python简单读写Xls格式文档的方法示例
Aug 17 Python
面向初学者的Python编辑器Mu
Oct 08 Python
在Pycharm中项目解释器与环境变量的设置方法
Oct 29 Python
pytorch神经网络之卷积层与全连接层参数的设置方法
Aug 18 Python
基于python2.7实现图形密码生成器的实例代码
Nov 05 Python
Python使用matplotlib绘制Logistic曲线操作示例
Nov 28 Python
Flask 上传自定义头像的实例详解
Jan 09 Python
matplotlib 画双轴子图无法显示x轴的解决方法
Jul 27 Python
用Python将库打包发布到pypi
Apr 13 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设计模式中的工厂模式
2008/06/12 PHP
php设计模式之职责链模式定义与用法经典示例
2019/09/19 PHP
浅谈laravel aliases别名的原理
2019/10/24 PHP
JQuery 小练习(实例代码)
2009/08/07 Javascript
js自动生成的元素与页面原有元素发生堆叠的解决方法
2014/09/04 Javascript
JS实现5秒钟自动封锁div层的方法
2015/02/20 Javascript
漂亮! js实现颜色渐变效果
2016/08/12 Javascript
微信小程序 开发MAP(地图)实例详解
2017/06/27 Javascript
vue+vuex+axios+echarts画一个动态更新的中国地图的方法
2017/12/19 Javascript
JavaScript实现写入文件到本地的方法【基于FileSaver.js插件】
2018/03/15 Javascript
深入了解JavaScript 的 WebAssembly
2019/06/15 Javascript
vue2.0 获取从http接口中获取数据,组件开发,路由配置方式
2019/11/04 Javascript
一篇文章带你使用Typescript封装一个Vue组件(简单易懂)
2020/06/05 Javascript
记录Django开发心得
2014/07/16 Python
使用Python3编写抓取网页和只抓网页图片的脚本
2015/08/20 Python
Python遍历pandas数据方法总结
2018/02/09 Python
python3基于TCP实现CS架构文件传输
2018/07/28 Python
Python实现的特征提取操作示例
2018/12/03 Python
python找出一个列表中相同元素的多个索引实例
2019/06/11 Python
详解pandas DataFrame的查询方法(loc,iloc,at,iat,ix的用法和区别)
2019/08/02 Python
在Python3 numpy中mean和average的区别详解
2019/08/24 Python
windows环境中利用celery实现简单任务队列过程解析
2019/11/29 Python
jupyter notebook 实现matplotlib图动态刷新
2020/04/22 Python
单身旅行者的单身假期:Just You
2018/04/08 全球购物
哈萨克斯坦最大的时装、鞋子和配饰在线商店:Lamoda.kz
2019/11/19 全球购物
final, finally, finalize的区别
2012/03/01 面试题
幸福家庭事迹材料
2014/02/03 职场文书
《巨人的花园》教学反思
2014/02/12 职场文书
《太阳》教学反思
2014/02/21 职场文书
科学发展观活动总结
2014/08/28 职场文书
解除租房协议书
2014/12/03 职场文书
教师听课评语大全
2014/12/31 职场文书
感谢信范文大全
2015/01/23 职场文书
2015年世界环境日演讲稿
2015/03/18 职场文书
心得体会该怎么写呢?
2019/06/27 职场文书
Mysql分析设计表主键为何不用uuid
2022/03/31 MySQL