Circular import problem

bvdp bob at
Fri Jul 13 04:36:16 CEST 2007

I'm going quite nutty here with an import problem. I've got a fairly
complicated program (about 12,000 lines in 34 modules). I just made
some "improvements" and get the following error:

bob$ mma
Traceback (most recent call last):
  File "/usr/local/bin/mma", line 55, in <module>
    import MMA.main
  File "/usr/local/share/mma/MMA/", line 33, in <module>
  File "/usr/local/share/mma/MMA/", line 34, in <module>
    import MMA.grooves
  File "/usr/local/share/mma/MMA/", line 41, in <module>
  File "/usr/local/share/mma/MMA/", line 35, in <module>
    import MMA.parse
  File "/usr/local/share/mma/MMA/", line 2052, in <module>
    'AUTHOR': ,
AttributeError: 'module' object has no attribute 'docs'

I can fix this by deleting a line in Just take out the
"import MMA.grooves" and all works. What I really don't get is that in
the middle of this module which is now NOT loading "" I have
a command to access a function in that module and it works.

Yes, has an import And there are lots of other
such imports in the program.

So, I have to assume that the error is being generated by some other
modules loading in the stuff ... but  really have no idea.

Is there anything I can do to trace though this and get it working

Oh, this is python 2.5.1 on Ubuntu Linux.


More information about the Python-list mailing list