您应该看一下
pipdeptree:
$ pip install pipdeptree$ pipdeptree -flWarning!!! Cyclic dependencies found:------------------------------------------------------------------------xlwt==0.7.5ruamel.ext.rtf==0.1.1xlrd==0.9.3openpyxl==2.0.4 - jdcal==1.0pymongo==2.7.1reportlab==3.1.8 - Pillow==2.5.1 - pip - setuptools
它不会
requirements.txt像您直接指示的那样生成文件。但是,源代码(255行python代码)应该相对容易地根据您的需要进行修改,或者您也可以(如pipdeptree
0.3 README中的@MERose所示)停用:
pipdeptree --freeze --warn silence | grep -P '^[w0-9-=.]+' > requirements.txt
的0.5版本
pipdeptree还允许使用带有
--json选项的JSON输出,该选项更易于机器解析,但以降低可读性为代价。



