Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'importerror:': 0.07; 'rename': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; '23,': 0.16; 'enum': 0.16; 'expecting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:import': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'module': 0.19; 'trying': 0.19; 'file,': 0.19; 'import': 0.22; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'library,': 0.24; 'cc:2**0': 0.24; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'see,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'posting': 0.31; 'that.': 0.31; '"",': 0.31; 'file': 0.32; 'open': 0.33; '(most': 0.33; 'skip:d 20': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'skip:" 50': 0.36; 'should': 0.36; 'clear': 0.37; 'thank': 0.38; 'nov': 0.38; 'pm,': 0.38; 'recent': 0.39; 'called': 0.40; 'skip:u 10': 0.60; 'entire': 0.61; "you're": 0.61; "you'll": 0.62; 'making': 0.63; 'show': 0.63; 'name': 0.63; 'here': 0.66; 'shadows': 0.84; 'write:': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Zbj81p7PTFcGVHVbiJ16S7Ng5WETUnpStIdpIRENVQ8=; b=F+RJYl628o5tCXn/OtF/7gjAyiczZrFaU5sXR6LqNWph+HjlUmLLoPYDdmMh0S4iQv jRRpB9Dl0r+GYx67JXUSMefivk23rvDbQAf/JdZV/qY2jvIPB1YV69D03ZWcwDGKnAqo HRKSoip8+EWcc8Zggzgd/hf+s67J6fv/higI58mX7BnxVVn7JhKN7vpu52QloGHAE/zk Pp2Joa3E8VhTXeqzQFot7CL2BxwHgn14XpaT3jaoXfp0fJKmts+wTz5xlYtBKB7sorsj f+RJE9r+ij/WKttcKbn5fvk/L9yQoi/pZK7394fs/rYnPEmdTP+8P3FiubLPxZNX6UsC sUpw== MIME-Version: 1.0 X-Received: by 10.42.64.143 with SMTP id g15mr13184083ici.59.1416745201106; Sun, 23 Nov 2014 04:20:01 -0800 (PST) In-Reply-To: References: Date: Sun, 23 Nov 2014 23:20:01 +1100 Subject: Re: ImportError: cannot import name 'Enum' From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416745203 news.xs4all.nl 2968 [2001:888:2000:d::a6]:49606 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81361 On Sun, Nov 23, 2014 at 11:10 PM, wrote: > Hello all, > > I am trying to use the python module but when I open the shell and write: > > ` import enum ` > > I get the following error > > ` Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python3.4/enum.py", line 3, in > from types import MappingProxyType, DynamicClassAttribute > File "/home/muhammed/workspace/python/unification/types.py", line 1, in > from enum import Enum > ImportError: cannot import name 'Enum' Thank you for making it so clear and easy! By posting the entire traceback, plus everything you're expecting to see, you clearly show what's going on. THANK YOU! What's happening here is that you have a file called "types.py". Unfortunately that name shadows the 'types' module in the standard library, and enum calls on that. So you'll need to rename your file, and then all should be well. ChrisA