Search code examples
pythonpipdependencies

pip dependency tree for a specific package version


I'm trying to see all the dependencies that are required for an specific package(in this case I'm using pipdeptree) but it turns out that it only shows me the dependency tree for an installed package. Let's say that I'm using graphene:2.1.0, so e.g:

$ 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]
------------------------------------------------------------------------

Now when I try $ pipdeptree -p graphene==40.0.2 (which does not exist).

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]
------------------------------------------------------------------------

It seems that it only takes into account a stable version, what I want is a dependency tree related to the specific version that I give by console, I hope I'm being clear with this.


Solution

  • I believe johnnydep can help with that:

    $ 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