MrDuk
MrDuk

Reputation: 18322

Import Error for module that pip reports as installed

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.

What can I try next?

Upvotes: 4

Views: 600

Answers (2)

ron rothman
ron rothman

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

offby1
offby1

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

Related Questions