A 'virtual' package (version 0.0.3) designed to provide `enum.Enum` compatibility across Python versions. Its sole purpose is to install the `enum34` backport on Python versions older than 3.4. On Python 3.4 and later, it acts as a no-op, as `enum` is part of the standard library. The project's last release was in October 2019, and it has no active development or release cadence.
pip install enum-compatVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the usage of Python's `enum.Enum` type, which `enum-compat` ensures is available. On Python 3.4+ this comes from the standard library; on older versions, `enum-compat` makes the `enum34` backport available as `enum`.
Remove `enum-compat` from your dependencies. Instead, specify `enum34` conditionally for Python versions less than 3.4 directly in your `setup.py` or `pyproject.toml`.
Ensure your project's dependency management (e.g., `setup.py`, `pyproject.toml`) only installs `enum34` when `python_version < "3.4"`.
Modern Python projects (Python 3.8+) should directly use the built-in `enum` module. For projects requiring Python 3.4-3.7, `enum` is built-in. Only very old projects requiring Python < 3.4 might have a legitimate, though discouraged, reason to use `enum34` directly.
Ensure `enum-compat` (or directly `enum34`) is installed for Python versions older than 3.4: `pip install enum-compat` or `pip install enum34`.
Uninstall `enum34` and `enum-compat` from your Python 3.4+ environment: `pip uninstall enum34 enum-compat`. The standard library `enum` module will then be used, which includes `IntFlag` and other newer features.
If `pip` is still functional, run `pip uninstall enum enum34`. If `pip` is broken, you may need to manually locate and delete the `enum.py` or `enum34` directory from your `site-packages` and then reinstall `pip`. For projects, use conditional dependencies like `enum34; python_version < "3.4"` in `requirements.txt` or `setup.py` to prevent `enum34` from being installed on Python 3.4+.