[Distutils] Possible to import from a zipfile retrieved from within an .egg using pkg_resource's ResourceManager API?

Dave Peterson dpeterson at enthought.com
Wed Jul 22 22:05:15 CEST 2009


P.J. Eby wrote:
> At 07:02 PM 7/21/2009 -0500, Dave Peterson wrote:
>
>> Or is there a better way to do this? Perhaps there is a way to force 
>> py2app/py2exe to avoid putting Mayavi within the site-packages zipfile?
>
> It would probably be better to extract tvtk_classes.zip to a directory 
> of the same name, so that instead of having nested zipfiles, there's 
> only one level of zipping, and you'll just be able to put the zipped 
> subdirectory on sys.path. (Note that you can put a subdirectory of a 
> zipfile on sys.path, and it'll still work. It's just that the 
> subdirectory has to be a directory inside the zipfile, not another 
> zipfile inside the zipfile.)

Thanks for the hint on a better direction! This appears to be an easy 
way to solve the py2app problem, though it requires a little 
modification to Mayavi itself since it attempts to dynamically add its 
tvtk_classes.zip to the sys.path. Just comment that out.

-- Dave



More information about the Distutils-SIG mailing list