[Solved]-There are incompatible versions in the resolved dependencies

5👍

You somehow managed to install beta versions (used the --pre flag before then deleted the option from Pipfile, for example or used pip directly in the virtual env).

Now, because django-graphql-jwt doesn’t conform to semantic versioning, they decided to depend on a major version, pre-release in a patch release ¯\_(ツ)_/¯
.

Since the 0.3.1 version of django-graphql-jtw depends on >=2.5.1, your beta version will still match, but without the --pre flag locking will fail, because the highest non-beta version is 2.5.1. That is the conflict being shown (but the output isn’t very clear).

The resolution that should solve the issue is:

pipenv uninstall django-graphql-jwt django-graphene graphene graphql
# followed by:
pipenv install 'django-graphql-jwt<0.3.2'

0👍

The problem seems to be that graphene-django only has version 2.15.0 according to PyPI https://pypi.org/project/graphene-django/. But for some reason in this commit of the library django-graphql-jwt it asks for
a version 3.0.0b1. Which I think is the issue that shows in your log:

ERROR: Could not find a version that matches graphene-django>=3.0.0b1 (from -r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 3))

Apparently in this commit the latest graphene-django version was still supported. So my guess is that maybe downgrading to:

django-graphql-jwt="0.3.1"

instead of 0.3.2 should solve the problem. And it this case you can report them the issue.

0👍

Actually Pipenv doesn’t have a smart enough dependency resolver. I ran into the similar issue and switched to poetry. Poetry will resolve your dependencies to the latest versions that match the constraints and don’t conflict with each other.
Poetry is also much faster than Pipenv and provides a better user experience.

# pyproject.toml

[build-system]
requires = ["poetry>=1.12"]
build-backend = "poetry.masonry.api"

[tool.poetry]
name = "sample"
version = "0.1.0"
description = "Sample"
authors = []

[tool.poetry.dependencies]
python = "~3.7"

django = "*"
django-graphql-jwt = "*"
pyjwt = "1.7.1"
django-cors-headers = "*"
graphene-django = "*"

In shell:

$ poetry --version
Poetry version 1.1.6

$ poetry lock
Updating dependencies
Resolving dependencies... (15.3s)

Writing lock file

$ poetry install
Installing dependencies from lock file

Package operations: 17 installs, 0 updates, 0 removals

  • Installing six (1.16.0)
  • Installing promise (2.3)
  • Installing rx (1.6.1)
  • Installing graphql-core (2.3.2)
  • Installing typing-extensions (3.10.0.0)
  • Installing aniso8601 (7.0.0)
  • Installing asgiref (3.3.4)
  • Installing graphql-relay (2.0.1)
  • Installing pytz (2021.1)
  • Installing django (3.2.3)
  • Installing graphene (2.1.8)
  • Installing singledispatch (3.6.2)
  • Installing text-unidecode (1.3)
  • Installing graphene-django (2.15.0)
  • Installing pyjwt (1.7.1)
  • Installing django-cors-headers (3.7.0)
  • Installing django-graphql-jwt (0.3.1)

Leave a comment