importing packages from a zip file

Scott David Daniels Scott.Daniels at Acm.Org
Wed Jun 29 19:36:29 CEST 2005

Peter Tillotson wrote:
> ... With the file system
> base/
>     branch1/
> At the same time its possible to store modules in a flat zip-file and
> import modules with the following.
> from import

Does this work for you?  It gives me a syntax error.

Typically, put the zip file on the sys.path list, and import modules
and packages inside it.  If you zip up the above structure, you can use:

     sys.path.insert(0, '')
     import base.branch1.myModule

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-list mailing list