Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'importerror:': 0.07; 'python': 0.08; 'foo': 0.09; 'lines:': 0.09; 'importerror': 0.16; 'subject:import': 0.16; '(most': 0.21; 'traceback': 0.24; 'import': 0.28; 'message-id:@mail.gmail.com': 0.29; 'error': 0.32; 'to:addr:python-list': 0.33; 'skip:# 10': 0.34; 'test': 0.34; 'dns': 0.34; 'last):': 0.34; 'skip:" 20': 0.35; 'file': 0.36; 'received:google.com': 0.38; 'subject:: ': 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; 'received:74.125': 0.39; 'subject:name': 0.67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=LWaUyzexjXPlqmKMmEwcUkEgN9e8bKhGVJprFnOSf6M=; b=sCYnMOTQfcAHOZ6BYhKr+MhoeUTc4V+CSoyWrS1aMiRzM9Q1JeuBeniSRsh9bm17pG USzcrSNEqf4cndOw7CjVX2nif/lzn6ZxImZWn5GCLoxGlo8kDXD4kEqIJ8MbiodPyQD4 D2rqLMGTbGN8IArC2syyp0wDlBuhzPjX7OUsI= MIME-Version: 1.0 Date: Tue, 13 Sep 2011 15:27:32 -0700 Subject: ImportError: cannot import name dns From: Jack Bates To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315952854 news.xs4all.nl 2490 [2001:888:2000:d::a6]:51697 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:13248 Why is the following ImportError raised? $ ./test Traceback (most recent call last): File "./test", line 3, in from foo import dns File "/home/jablko/foo/dns.py", line 1, in from foo import udp File "/home/jablko/foo/udp.py", line 1, in from foo import dns ImportError: cannot import name dns $ I reproduce this error with the following four files and five lines: == foo/dns.py == from foo import udp == foo/udp.py == from foo import dns == foo/__init__.py == (empty) == test == #!/usr/bin/env python from foo import dns