Importing XML modules in py2exe or Installer?

Gustaf Liljegren gustafl at algonet.se
Sat Jul 14 13:04:38 EDT 2001


Gordon McMillan <gmcm at hypernet.com> wrote:

>Doesn't help to use py2exe args with Installer!

Sorry, misunderstood this first. Haven't used ConfigParser before.

>Edit myscript.cfg and put
>packages=_xmlplus
>in the PYZ section.

It don't work. Here's what I have done:

1. Extracted Installer in e:\installer.

2. Moved all my project files to e:\python\gustaf, which is in my Python 
path (sys.path). The project consists of jane.py + 4 other .py files with 
classes and functions.

3. Went to e:\python\gustaf and typed:

python e:\installer\simple.py jane.py

All 5 .py files modules were compiled into .pyc files. Apart from that, I 
also got the following new files:

Install_jane.exe
jane.exe
jane.cfg
gen_install.pyc
gen_install.py
Builder.log
installzlib.pyz
jane.pyz

5. Opened the jane.cfg file:

[MYINSTALL]
type= INSTALL
name= Install_jane.exe
bindepends= jane.py
zlib = INSTALLZLIB
misc= MYSTANDALONE
debug = 0
excludes = pywintypes, win32api

[MYSTANDALONE]
type= STANDALONE
name= jane.exe
script= jane.py
zlib = APPZLIB
userunw = 0
support = 0
debug = 0

[APPZLIB]
name= jane.pyz
dependencies= jane.py
excludes= dospath, posixpath, macpath

[INSTALLZLIB]
name = installzlib.pyz
dependencies = installutils
includes = installutils
excludes = dospath, posixpath, macpath

Either these header sections are not documented as they appear, or I'm 
looking in the wrong place. The Installer docs talk about PYZ, COLLECT, 
CARCHIVE, STANDALONE, FULLEXE and INSTALL.

6. Added a [PYZ] header section + a 'packages' property in the jane.cfg 
file:

[PYZ]
packages=_xmlplus

7. Ran Builder.py on the new jane.cfg:

E:\python\gustaf>python e:\installer\builder.py jane.cfg
W: exec statment detected at line 281 of imputil
W: No module named dos
W: No module named mac
W: No module named nt.stat
W: No module named os2
W: No module named posix
W: Cannot determine your Windows or System directories
W: Please add them to your PATH if .dlls are not found
Traceback (most recent call last):
  File "e:\installer\builder.py", line 596, in ?
    main(args)
  File "e:\installer\builder.py", line 541, in main
    target = makeTarget(cfg, section)
  File "e:\installer\builder.py", line 479, in makeTarget
    return dispatch[cfg.get(section, 'type')](cfg, section, optcnvrts)
  File "e:\installer\builder.py", line 110, in __init__
    Target.__init__(self, cfg, sectnm, cnvrts)
  File "e:\installer\builder.py", line 45, in __init__
    self.__name__ = self.name
AttributeError: PYZTarget instance has no attribute 'name'

And here I am. If you need to see the code, the project files can be found 
at:

http://www.algonet.se/~gustafl/dev/jane/code/

Regards,

Gustaf Liljegren



More information about the Python-list mailing list