特定包版本的pip依赖关系树

2024-05-13 15:50:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图查看特定包所需的所有依赖项(在本例中,我使用的是pipdeptree),但结果表明,它只显示已安装包的依赖项树。假设我使用的是石墨烯: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]
------------------------------------------------------------------------

它似乎只考虑了一个稳定的版本,我想要的是一个依赖关系树,它与我通过控制台提供的特定版本相关,我希望我已经清楚了这一点


Tags: installedcoreauthrequiredsocialdependenciesrequestsgraphql
1条回答
网友
1楼 · 发布于 2024-05-13 15:50:58

我相信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

相关问题 更多 >