Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #13248 > unrolled thread

ImportError: cannot import name dns

Started byJack Bates <jack.bates@gmail.com>
First post2011-09-13 15:27 -0700
Last post2011-09-13 15:27 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  ImportError: cannot import name dns Jack Bates <jack.bates@gmail.com> - 2011-09-13 15:27 -0700

#13248 — ImportError: cannot import name dns

FromJack Bates <jack.bates@gmail.com>
Date2011-09-13 15:27 -0700
SubjectImportError: cannot import name dns
Message-ID<mailman.1091.1315952854.27778.python-list@python.org>
Why is the following ImportError raised?

$ ./test
Traceback (most recent call last):
  File "./test", line 3, in <module>
    from foo import dns
  File "/home/jablko/foo/dns.py", line 1, in <module>
    from foo import udp
  File "/home/jablko/foo/udp.py", line 1, in <module>
    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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web