Opened 8 days ago

Last modified 8 days ago

#28878 new Bug

"pip install django" is broken on Python 2; can be fixed for most users with metadata

Reported by: Zac Hatfield Dodds Owned by: nobody
Component: Packaging Version: 2.0
Severity: Release blocker Keywords:
Cc: Sergey Fedoseev Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


For users on Python 2, 'pip install django' should install the latest compatible version, which is 1.11.x.

Unfortunately, it currently tries to install Django 2.0, and throws an error (the details are unimportant, except that it's a terrible user experience). This is unfortunately inevitable for users with very old versions of pip, who are therefore out of luck unless they upgrade it.

For any user with pip 9+ though, we can use the python-requires argument to 'setuptools.setup'. All users will then transparently get the latest version that is compatible with their Python, and all will be well. has a range of further advice on making this process as smooth as possible, including tips about setuptools versions and where to insert explicit warnings and errors for users who somehow get an incompatible version anyway.

I'd be happy to review any patches in relation to this, or help write them if someone can help with django-specific questions :-)

Change History (3)

comment:1 Changed 8 days ago by Sergey Fedoseev

Cc: Sergey Fedoseev added

comment:2 Changed 8 days ago by Sergey Fedoseev

Triage Stage: UnreviewedAccepted

comment:3 Changed 8 days ago by Zac Hatfield Dodds

Has patch: set


I've made the patch against master, and included some notes on backporting and required edits to the PyPI listing in the pull description. Very happy to hear any feedback!

Note: See TracTickets for help on using tickets.
Back to Top