pip相关工具使用小结
最近写taffy的时候用到了两个pip相关的小工具。
一个是pip-review批量更新lib库,一个是pipreqs生成基于项目的requirements.txt。
1. pip相关命令
#更新单个lib(不能批量更新)
$ pip install --upgrade xxx #生成全部requirements.txt(不能基于项目生成)
$ pip freeze > requirements.txt
2. pip-review
github地址:https://github.com/jgonggrijp/pip-review
使用pip install直接安装即可:
$ pip install pip-review
基本使用方法:
#查看可更新lib
$ pip-review #自动批量升级lib
$ pip-review --auto #以交互方式运行,对每个包进行升级
$ pip-review --interactive
3. pipreqs
github地址:https://github.com/bndr/pipreqs
同样使用pip install命令安装即可:
$ pip install pipreqs
用法:
Usage:
pipreqs [options] <path> Options:
--use-local Use ONLY local package info instead of querying PyPI
--pypi-server <url> Use custom PyPi server
--proxy <url> Use Proxy, parameter will be passed to requests library. You can also just set the
environments parameter in your terminal:
$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="https://10.10.1.10:1080"
--debug Print debug information
--ignore <dirs>... Ignore extra directories
--encoding <charset> Use encoding parameter for file open
--savepath <file> Save the list of requirements in the given file
--print Output the list of requirements in the standard output
--force Overwrite existing requirements.txt
--diff <file> Compare modules in requirements.txt to project imports.
--clean <file> Clean up requirements.txt by removing modules that are not imported in project.
示例:
#生成location项目requirements.txt
$ pipreqs /home/project/location
Successfully saved requirements file in /home/project/location/requirements.txt #覆盖生成requirements.txt
$ pipreqs --force /home/project/location
pip相关工具使用小结的更多相关文章
- pip 常用命令小结
pip 常用命令小结 pip这个工具我们经常会用到,毕竟python 是一门以第三方库庞大而著名的编程语言,所以我们总会用pip 安装一些依赖库,当然这只是pip 最常用的一个命令,下面就来介绍一下 ...
- pip的问题小结
Q:同时安装py2和py3后,pip2不能用 A:使用:python2 -m pip install xxx 代替 pip2 install xxx 命令 Q:怎么用pip更新第三方包 A:pip2 ...
- pip命令小结
pip的另一种调用方式 python -m pip通过指定python的名字来指定特定的pip pip freeze > 项目目录/requirements.txt导出pip中下载的包目录 pi ...
- numpy用法小结
前言 个人感觉网上对numpy的总结感觉不够详尽细致,在这里我对numpy做个相对细致的小结吧,在数据分析与人工智能方面会有所涉及到的东西在这里都说说吧,也是对自己学习的一种小结! numpy用法的介 ...
- python入门:python包管理工具pip的安装
pip 是一个安装和管理 Python 包的工具 , 是 easy_install 的一个替换品. distribute是setuptools的取代(Setuptools包后期不再维护了),pip是e ...
- pandas用法小结
前言 个人感觉网上对pandas的总结感觉不够详尽细致,在这里我对pandas做个相对细致的小结吧,在数据分析与人工智能方面会有所涉及到的东西在这里都说说吧,也是对自己学习的一种小结! pandas用 ...
- 函数计算 Python 连接 SQL Server 小结
python 连接数据库通常要安装第三方模块,连接 MS SQL Server 需要安装 pymssql .由于 pymsql 依赖于 FreeTDS,对于先于 2.1.3 版本的 pymssql,需 ...
- 基于python的Selenium使用小结
之前介绍过基于Unittest和TestNG自动化测试框架,然而基于Web端的测试的基础框架是需要Selenium做主要支撑的,这里边给大家介绍下Web测试核心之基于Python的Selenium 一 ...
- 【Python】Python点滴(一)——pip工具使用
首先我们来看一条命令:pip install uwsgi 这条命令按照操作名称,可以分为三个部分:pip.install和uwsgi.接下来,按照这样三个部分进行分析. pip pip类似于Rea ...
随机推荐
- Fiddler抓取https证书问题
正常的使用方法 Fiddler 抓包工具总结 大部分问题的解决方案 fiddler4在win7抓取https的配置整理 像我脸一样黑的解决方案 Fiddler https 证书问题 ...
- echarts饼图点击事件
/** * 点击事件 */myChart2.on('click', function (param) { var index = param.dataIndex; alert(index);});
- 【Java数据结构学习笔记之一】线性表的存储结构及其代码实现
应用程序后在那个的数据大致有四种基本的逻辑结构: 集合:数据元素之间只有"同属于一个集合"的关系 线性结构:数据元素之间存在一个对一个的关系 树形结构:数据元素之间存在一个对多个关 ...
- [bzoj4240] 有趣的家庭菜园
还是膜网上题解QAQ 从低到高考虑,这样就不会影响后挪的草了. 每次把草贪心地挪到代价较小的一边.位置为i的草,花费为min( 1..i-1中更高的草的数目,i+1..n中更高的草的数目 ) 因为更小 ...
- POJ3258-River Hopscotch-二分
这个题就是排排坐,二分就可以了... River Hopscotch Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1325 ...
- 哈密顿绕行世界问题(dfs+记录路径)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2181 哈密顿绕行世界问题 Time Limit: 3000/1000 MS (Java/Others) ...
- Graph(Floyd)
http://acm.hdu.edu.cn/showproblem.php?pid=4034 Graph Time Limit: 2000/1000 MS (Java/Others) Memor ...
- Digit Generator(水)
题目链接:http://acm.tju.edu.cn/toj/showp2502.html2502. Digit Generator Time Limit: 1.0 Seconds Memor ...
- linux命令 uname -r 和 uname -a 的解释与演示
1.uname -r : 显示操作系统的发行版号2.uname -a :显示系统名.节点名称.操作系统的发行版号.内核版本等等. 系统名:Linux 节点名称: iZ2zeeailqvwws5dcui ...
- Document类型知识大全
Document类型 1.文档的子节点 Document类型可以表示HTML页面或者其他基于XML的文档.不过,最常见的应用还是作为HTMLDocument实例的document对象.通过这个文档对 ...