Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'importerror:': 0.07; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'received:dip.t-dialin.net': 0.16; 'received:t-dialin.net': 0.16; 'subject:import': 0.16; 'wrote:': 0.18; 'figure': 0.23; 'debian': 0.23; 'from:addr:web.de': 0.23; 'import': 0.27; 'problem': 0.29; 'imported': 0.30; "can't": 0.32; 'header:X-Complaints-To:1': 0.33; 'to:addr:python-list': 0.34; 'file': 0.36; 'two': 0.37; 'but': 0.37; 'could': 0.37; 'using': 0.38; 'received:org': 0.38; 'files': 0.39; 'why': 0.39; 'to:addr:python.org': 0.40; 'details,': 0.74; 'pardon': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: import problems. Date: Wed, 11 Jan 2012 14:57:35 +0100 Organization: None References: <4F0D8CF5.1090508@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p5084a39f.dip.t-dialin.net X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326290256 news.xs4all.nl 6902 [2001:888:2000:d::a6]:35141 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18830 Antoon Pardon wrote: > I have an import problem I can't figure out. > I am using python 2.6.6 on a debian box > > In one directory (pylib) I have a file misc.py and > the file testutil.py. > from misc import Rec > ImportError: cannot import name Rec > > Why can I import Rec from misc in testutil when I call testutil.py > directly but not when testutil was imported itself? Without looking into the details, could it be that you have two misc.py files one with and one without Rec?