requests: idna 3.0 version package conflict

idna released version 3.0 but requests has a dependency on idna<3, this makes it impossible to keep up to date on both packages.

Expected Result

I want to be able to install the latest idna package alongside the latest requests package

Actual Result

ERROR: Cannot install -r requirements.txt (line 12) and idna==3.0 because these package versions have conflicting dependencies.

The conflict is caused by:

    The user requested idna==3.0

    requests 2.25.1 depends on idna<3 and >=2.5

Reproduction Steps

try to run pip install on a requirements.txt file with

requests==2.25.1
idna==3.0

System Information

multiple Python versions (3.6 up to 3.9) running on Docker containers inside Drone CI/CD

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 88
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@sethmlarson how long do we have to keep using older version of idna? This is essentially blocking us from using latest version of it. I don’t think that should be suggested to anyone.

@hartwork https://github.com/psf/requests/pull/5711 will fix this, @psf are just sitting on it until the next release

Upgrading idna requires dropping python 2.7 so whenever that happens unless someone adds python_version markers to the dependancies

As urllib3[secure] defines

https://github.com/urllib3/urllib3/blob/3f21165969b838fda29898cbd7218ac9578e319b/setup.py#L119

"idna>=2.0.0",

This causes pip 20.2.1 to show warning:

> pip install urllib3[secure] requests --force-reinstall
...
Collecting idna>=2.0.0; extra == "secure"
  Using cached idna-3.1-py3-none-any.whl (58 kB)
...
requests 2.25.1 requires idna<3,>=2.5, but you'll have idna 3.1 which is incompatible.