Jamie C wrote:

I dealt with the issue where you do "import directory.pythonfile" by
just putting everything in the same directory and changing it to
"import pythonfile"
That should work, no? Why do you need the hack?
Well, I dunno why this is, but just running veusz.py gives the error:

  import windows.mainwindow
ImportError: No module named windows.mainwindow

and quits. And so on for all the other import dir.pyfile statements.
So it doesn't work, but I don't know why that is... possibly something
to do with this (mainwindow.py):

# this allows modules relative to this one to be used,
# allowing this program to be run from python, or using this script
# please suggest a replacement for this
sys.path.insert( 0, os.path.dirname(__file__) )

Or maybe I'm starting it wrong, or my setup is weird - which is pretty
likely given that it's windows.
It might well be because the __init__.py files don't define __all__ which AFAIK is needed for locating modules in Windows. If so this should be trivial to fix.

--
"But if science you say still sounds too deep,
Just do what Beaker does, just shrug and 'Meep!'"

-- Dr. Bunsen Honeydew & Beaker of Muppet Labs


Répondre à