13
votes

I'm running a code with Python 2.7. And I get "ImportError: No module named enum". I installed enum with "pip install enum" but the error keeps coming. What shall I do??

2
type pip show enum in the command prompt and see what it says under "Requires" - sam-pyt
it shows nothing! - SH ShaHad

2 Answers

16
votes

You want the backport:

pip install enum34

The distribution named enum on PyPI is something else, unfortunately.

7
votes

The enum module is part of Python 3.4 (and later) stdlib but not part of Python 2.7 stdlib.

Fortunately, there's an available backport suitable to Python 2.7. Install it and play with it.

https://pypi.python.org/pypi/enum34