Sporadic problems importing xml.dom.minidom

Discussion in 'Python' started by Michael Robinson, May 27, 2004.

  1. Sometimes when I run a program I get the message "Import:Error No Moduel
    named dom.domino", sometimes it imports OK. It seems to depend on the
    working directory when I star the program.

    /home/mike/projects/xml_test/test.py:

    Gives an erroor, the same file luanched from

    /home/mike/projects/xml1/test.py:

    runs without a problem

    I am running the python 2.3 package, bundeld with Fedora Core 2.
     
    Michael Robinson, May 27, 2004
    #1
    1. Advertising

  2. Michael Robinson wrote:
    > Sometimes when I run a program I get the message "Import:Error No Moduel
    > named dom.domino", sometimes it imports OK. It seems to depend on the
    > working directory when I star the program.
    >
    > /home/mike/projects/xml_test/test.py:
    >
    > Gives an erroor, the same file luanched from
    >
    > /home/mike/projects/xml1/test.py:
    >
    > runs without a problem
    >
    > I am running the python 2.3 package, bundeld with Fedora Core 2.


    UPDATE:
    It seems that some of the folders where the program worked, no longer work.
     
    Michael Robinson, May 27, 2004
    #2
    1. Advertising

  3. Michael Robinson wrote:
    > Sometimes when I run a program I get the message "Import:Error No Moduel
    > named dom.domino", sometimes it imports OK. It seems to depend on the
    > working directory when I star the program.
    >
    > /home/mike/projects/xml_test/test.py:
    >
    > Gives an erroor, the same file luanched from
    >
    > /home/mike/projects/xml1/test.py:
    >
    > runs without a problem
    >
    > I am running the python 2.3 package, bundeld with Fedora Core 2.


    I think i solved the problem. I had another file in those directorys
    called xml.py, I guess that was interfeering
     
    Michael Robinson, May 27, 2004
    #3
  4. Michael Robinson

    Peter Hansen Guest

    Michael Robinson wrote:

    > Michael Robinson wrote:
    >
    >> Sometimes when I run a program I get the message "Import:Error No
    >> Moduel named dom.domino", sometimes it imports OK. It seems to depend
    >> on the working directory when I star the program.
    >>
    >> /home/mike/projects/xml_test/test.py:
    >>
    >> Gives an erroor, the same file luanched from
    >>
    >> /home/mike/projects/xml1/test.py:
    >>
    >> runs without a problem
    >>
    >> I am running the python 2.3 package, bundeld with Fedora Core 2.

    >
    > I think i solved the problem. I had another file in those directorys
    > called xml.py, I guess that was interfeering


    That could do it, and possibly compounding your problem was
    that even a leftover xml.pyc file (from your xml.py file when
    it was imported another time) would still cause the trouble.
    If you do have a problem with a name collision like that,
    always be sure to nuke the .py *and* the .pyc file at the
    same time.

    -Peter
     
    Peter Hansen, May 28, 2004
    #4
    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. Roman Yakovenko

    xml.dom.minidom - bug ? future ?

    Roman Yakovenko, Sep 4, 2003, in forum: Python
    Replies:
    1
    Views:
    357
    =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=
    Sep 4, 2003
  2. Greg Wogan-Browne
    Replies:
    1
    Views:
    885
    Uche Ogbuji
    Jan 28, 2005
  3. Replies:
    3
    Views:
    567
    Stefan Behnel
    Aug 3, 2007
  4. Johannes Bauer
    Replies:
    7
    Views:
    1,096
    Johannes Bauer
    Jun 11, 2009
  5. ming
    Replies:
    2
    Views:
    238
Loading...

Share This Page