ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> py2exe-users
py2exe-users
[Py2exe-users] Re: How to add a package loaded at run time
by Thomas Heller other posts by this author
Jun 18 2004 11:24AM messages near this date
[Py2exe-users] Re: How to add a package loaded at run time | Re: [Py2exe-users] How to add a package loaded at run time
"Bruno Santos" <bmsantos@[...].es>  writes:

>  Hi Tacao,
> 
>  Thanks for your prompt answer, but unfortunatly is still not working.
>  All the glob does is to easy the copy of ".py" or ".pyc" files into the
>  subdirectory "pool".
> 
>  It fails when I try to import a .py file stored in the "pool" module directory.
> 
>           try:
>               myModule = __import__("pool.classnode", globals(), locals(), ["getNodeInfo"])
>           except ImportError, aError:
>               print aError
> 
>  So, I get a error message of : "No module named pool.classnode"
> 
>  This makes me beleive that it is something related in the way that py2exe stores
>  the module information. Therefore I'm still stucked with the same problem.

I think it is because the *only* entry in sys.path is the library.zip
file.

See <http://starship.python.net/crew/theller/moin.cgi/Py2exeEnvironment> 

You should probably in your script check for the sys.frozen attribute,
and extend sys.path yourself.

Thomas



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Py2exe-users mailing list
Py2exe-users@[...].net
https://lists.sourceforge.net/lists/listinfo/py2exe-users
Thread:
Bruno Santos
Greg
Thomas Heller
E. A. Tacao
Bruno Santos

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved