pip安装工具缺少导入等
pipr的Python项目详细描述
用于pip安装的工具缺少导入等
说明
pipr可以为任何python文件安装缺少的依赖项并生成requirements.txt文件,这样您就不必担心手动搜索和安装依赖项了
要求
pipr同时支持python 2.7和python 3.4
安装
要安装pipr,只需:
$ pip install pipr
用法
$ pipr -h usage: pipr [-h] [-r] [-d] [-R] filepath positional arguments: filepath The path to the Python file optional arguments: -h, --help show this help message and exit -r, --requirements Add --requirements to generate a requirements.txt file in current directory -d, --debug Add --debug to see debug output -R, --recursive Add --recursive to handle project-wide dependency
$ cat test.py import argparse import sshmap, redislite import urllib2 import sbi # import commentimp from time import sleep ''' import commentimp2 ''' $ pipr test.py -d -r Imported packages: argparse, sshmap, redislite, urllib2, sbi, time Missing packages installed: sshmap==0.6.90, sbi==0.0.7
因为我们添加了-r,所以将在当前目录中生成一个requirements.txt文件。
更多信息
- 免费软件:BSD许可证,有关详细信息,请参见license.txt
- 文档:https://pipr.readthedocs.org
- 贡献:我们欢迎拉请求!请查看contribution.md了解要求
- 联系方式:ypython@yahoogroups.com