Python updated pip (new dependency resolver)

Change effective on 01 November 2021

The packaging tools used during the build of Python apps have been updated as follows:

  • pip updated from 20.2.4 to:
    • 20.3.4 for Python 2.7 and 3.5
    • 21.3.1 for Python 3.6+

On Python 3, pip now uses its new dependency resolver, which is by design more strict.

Dependency versions are now fully validated during installation and the pip install step will fail with a ResolutionImpossible error if dependency conflicts are found. Previously pip would allow the installation of such invalid combinations of dependencies, which could result in application bugs or other breakage. As of pip 20.2 (July 2020) warnings have been shown in the pip install output that these dependency conflicts would eventually become fatal.

If you encounter such ResolutionImpossible errors, see dealing with dependency conflicts.

In addition, as part of determining which dependency versions to install, pip may also now backtrack during package installation to try and find a non-conflicting set of dependencies to install. If this process takes too long during a build, see possible ways to reduce backtracking.

We strongly recommend fixing your application’s dependencies to resolve these issues, since they typically indicate real incompatibilities between your app’s dependencies.

However, if you are unable to do so at this time, as a temporary workaround you can continue to use the previous version of pip by pinning your application’s Python buildpack version to the previous release. To do this, use a buildpack URL of https://github.com/heroku/heroku-buildpack-python.git#v201 . Make sure to return to the recommended heroku/python buildpack URL/alias once your app is compatible with the new resolver. For more information, see setting a buildpack on an application, or if your app uses multiple buildpacks, see the steps here.