ImportError: cannot import name dns

Discussion in 'Python' started by Jack Bates, Sep 13, 2011.

  1. Jack Bates

    Jack Bates Guest

    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
     
    Jack Bates, Sep 13, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jang, seungwook
    Replies:
    1
    Views:
    383
    Guido Goldstein
    Jan 15, 2004
  2. Replies:
    1
    Views:
    823
    Steven Bethard
    May 21, 2005
  3. asoft
    Replies:
    0
    Views:
    523
    asoft
    Jun 22, 2008
  4. zerosumgame
    Replies:
    0
    Views:
    548
    zerosumgame
    Apr 28, 2009
  5. Mark Lawrence
    Replies:
    1
    Views:
    126
    Marco Buttu
    Jan 5, 2014
Loading...

Share This Page