|
| 1 | +:orphan: |
| 2 | + |
| 3 | +Python 2 Sunset |
| 4 | +=============== |
| 5 | + |
| 6 | +Since January 2020 and the release of Setuptools 45, Python 2 is no longer |
| 7 | +supported by the most current release (`discussion |
| 8 | +<https://github.com/pypa/setuptools/issues/1458>`_). Setuptools as a project |
| 9 | +continues to support Python 2 with bugfixes and important features on |
| 10 | +Setuptools 44.x. |
| 11 | + |
| 12 | +By design, most users will be unaffected by this change. That's because |
| 13 | +Setuptools 45 declares its supported Python versions to exclude Python 2.7, |
| 14 | +and installers such as pip 9 or later will honor this declaration and prevent |
| 15 | +installation of Setuptools 45 or later in Python 2 environments. |
| 16 | + |
| 17 | +Users that do import any portion of Setuptools 45 or later on Python 2 are |
| 18 | +directed to this documentation to provide guidance on how to work around the |
| 19 | +issues. |
| 20 | + |
| 21 | +Workarounds |
| 22 | +----------- |
| 23 | + |
| 24 | +The best recommendation is to avoid Python 2 and move to Python 3 where |
| 25 | +possible. This project acknowledges that not all environments can drop Python |
| 26 | +2 support, so provides other options. |
| 27 | + |
| 28 | +In less common scenarios, later versions of Setuptools can be installed on |
| 29 | +unsupported Python versions. In these environments, the installer is advised |
| 30 | +to first install ``setuptools<45`` to "pin Setuptools" to a compatible |
| 31 | +version. |
| 32 | + |
| 33 | +- When using older versions of pip (before 9.0), the ``Requires-Python`` |
| 34 | + directive is not honored and invalid versions can be installed. Users are |
| 35 | + advised first to upgrade pip and retry or to pin Setuptools. Use ``pip |
| 36 | + --version`` to determine the version of pip. |
| 37 | +- When using ``easy_install``, ``Requires-Python`` is not honored and later |
| 38 | + versions can be installed. In this case, users are advised to pin |
| 39 | + Setuptools. This applies to ``setup.py install`` invocations as well, as |
| 40 | + they use Setuptools under the hood. |
| 41 | + |
| 42 | +It's still not working |
| 43 | +---------------------- |
| 44 | + |
| 45 | +If after trying the above steps, the Python environment still has incompatible |
| 46 | +versions of Setuptools installed, here are some things to try. |
| 47 | + |
| 48 | +1. Uninstall and reinstall Setuptools. Run ``pip uninstall -y setuptools`` for |
| 49 | + the relevant environment. Repeat until there is no Setuptools installed. |
| 50 | + Then ``pip install setuptools``. |
| 51 | +2. If possible, attempt to replicate the problem in a second environment |
| 52 | + (virtual machine, friend's computer, etc). If the issue is isolated to just |
| 53 | + one unique enviornment, first determine what is different about those |
| 54 | + environments (or reinstall/reset the failing one to defaults). |
| 55 | +3. End users who are not themselves the maintainers for the package they are |
| 56 | + trying to install should contact the support channels for the relevant |
| 57 | + application. Please be considerate of those projects by searching for |
| 58 | + existing issues and following the latest guidance before reaching out for |
| 59 | + support. When filing an issue, be sure to give as much detail as possible |
| 60 | + to help the maintainers understand what factors led to the issue after |
| 61 | + following their recommended guidance. |
| 62 | +4. Reach out to your local support groups. There's a good chance someone |
| 63 | + nearby has the expertise and willingness to help. |
| 64 | +5. If all else fails, `file this template |
| 65 | + <https://github.com/pypa/setuptools/issues/new?assignees=&labels=Python+2&template=setuptools-warns-about-python-2-incompatibility.md&title=Incompatible+install+in+(summarize+your+environment)>`_ |
| 66 | + with Setuptools. Please complete the whole template, providing as much |
| 67 | + detail about what factors led to the issue. Setuptools maintainers will |
| 68 | + summarily close tickets filed without any meaningful detail or engagement |
| 69 | + with the issue. |
0 commit comments