py2exe importing a package not in library.zip
mypetslug at gmail.com
mypetslug at gmail.com
Wed Aug 20 16:48:10 EDT 2008
Hi,
I'm sorry if this has been asked before, but I can't seem to find an
answer to this anywhere and so far, trial and error hasn't gotten me
far either.
Using python 2.4, I've created a testing application. When the app
starts up, I do a [code]from tests import *[/code] and it looks at
the /tests directory and loads up all the tests it finds at that
time. This works fine when interpreting the python code directly.
The problem I'm having is trying to create an executable for
distribution.
What I'd like to be able to do is to include everything in the
library.zip *except* the tests directory and then as I (or whoever)
creates more and more tests, have the ability to simply drop them into
the directory and the next time the app starts, it'll pick them up.
However, if I don't include the tests in library.zip, then when I hit
the [code]from tests import *[/code], it complains "AttributeError:
'module' object has no attribute 'test1'" when it gets to the first
test. And If I do include the tests in the library.zip, it works with
the tests that I have now, but then I still can't add any new ones
without the attribute error unless I regenerate the exe every time.
Basically, it seems like it comes down to importing a package outside
the library.zip. So, is there any way to do this with py2exe? Or
even another exe creating application?
Thanks,
MyPetSlug
More information about the Python-list
mailing list