针对特定软件包版本的pip依赖树

3

我想查看特定软件包所需的所有依赖项(在这种情况下,我使用pipdeptree),但事实证明它仅向我显示已安装软件包的依赖树。 假设我正在使用graphene:2.1.0,例如:

$ pipdeptree -p graphene

Warning!!! Possibly conflicting dependencies found:
* graphql-relay==0.5.0
 - graphql-core [required: >=0.5.0,<2, installed: 2.3.1]
* social-auth-core==3.2.0
 - requests [required: >=2.9.1, installed: 2.8.1]
------------------------------------------------------------------------

现在当我尝试执行 $ pipdeptree -p graphene==40.0.2 (该版本不存在)时。

Warning!!! Possibly conflicting dependencies found:
* graphql-relay==0.5.0
 - graphql-core [required: >=0.5.0,<2, installed: 2.3.1]
* social-auth-core==3.2.0
 - requests [required: >=2.9.1, installed: 2.8.1]
------------------------------------------------------------------------

看起来它只考虑了稳定版本,我想要的是一个与我在控制台中指定的特定版本相关的依赖树,希望我表达清楚了。


你应该使用一个新的虚拟环境。 - Klaus D.
如果我没记错的话,johnnydep 可以帮忙解决这个问题。 - sinoroc
1个回答

6

我相信johnnydep可以帮助解决这个问题:

$ johnnydep --verbose 0 'graphene==2.1.0'
name                            summary
------------------------------  ---------------------------------------
graphene==2.1.0                 GraphQL Framework for Python
├── aniso8601<4,>=3             A library for parsing ISO 8601 strings.
├── graphql-core<3,>=2.0        GraphQL implementation for Python
│   ├── promise<3,>=2.3         Promises/A+ implementation for Python
│   │   └── six                 Python 2 and 3 compatibility utilities
│   ├── rx<2,>=1.6              Reactive Extensions (Rx) for Python
│   └── six>=1.10.0             Python 2 and 3 compatibility utilities
├── graphql-relay<1,>=0.4.5     Relay implementation for Python
│   ├── graphql-core<2,>=0.5.0  GraphQL implementation for Python
│   │   ├── promise>=2.0        Promises/A+ implementation for Python
│   │   │   └── six             Python 2 and 3 compatibility utilities
│   │   └── six>=1.10.0         Python 2 and 3 compatibility utilities
│   ├── promise>=0.4.0          Promises/A+ implementation for Python
│   │   └── six                 Python 2 and 3 compatibility utilities
│   └── six>=1.10.0             Python 2 and 3 compatibility utilities
├── promise<3,>=2.1             Promises/A+ implementation for Python
│   └── six                     Python 2 and 3 compatibility utilities
└── six<2,>=1.10.0              Python 2 and 3 compatibility utilities

这正是我一直在寻找的,非常感谢! - Nick Cuevas

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接