Reputation: 18322
I'm trying to run a script using the backport of Enum
for python 2.7.8, through Cygwin.
When the script is run, it outputs the generic error of Import Error: No module named Enum
.
pip-2.7 install enum34
says that it's already installed pip-2.7 install enum34 --upgrade
gave the same errorpython --version
shows 2.7.8pip freeze
shows enum=1.0.4
pip uninstall enum34 / pip install enum34
produced no differenceWhat can I try next?
Upvotes: 4
Views: 600
Reputation: 18168
It's a bit confusing, but you need to import from enum
, not enum34
:
Here's an example from the docs:
from enum import Enum
class Color(Enum):
red = 1
green = 2
blue = 3
Upvotes: 1
Reputation: 7023
You didn't paste your code, but I'm guessing that you wrote
import Enum
with a capital E. Try again with a lower-case "e":
import enum
Upvotes: 0