HELP -- py2exe failed to build app that uses scipy.plt

eric eric at enthought.com
Thu Oct 25 11:18:49 EDT 2001


Hey Phil,

I haven't ever used py2exe, so I'll be of little help.  I can't say
I'm surprised though.  The __init__ files in SciPy have some strange
importing
practices that may make it hard for py2exe to determine the needed
modules.  I don't know how hard it is to fix this sort of thing -- or
even if it is the problem.

You could try and pull plt out of scipy and use it stand alone, but
would require at least some hacking as there are some dependencies.

sorry I don't have more info.

eric

pho56 at yahoo.com.au (Phil Ho) wrote in message news:<436bca17.0110181944.247f4ecd at posting.google.com>...
> Hi,
> 
> Sorry for this lengthy message. I do appreciate if you could help,
> give me some hints or workarounds etc. for this py2exe (0.2.6)
> conversion problem.
> 
> I built an application under Windows NT4.0 with ActivePython 2.1.1,
> SciPy-0.1 and wxPython 2.3. Basically it has:
> 
> 1. An GUI in wxPython
> 2. Access binary data from a database that return as Numeric arrays.
> 3. Plot the data array using scipy.plt which is also implemented in 
>    wxPython.
> 
> The app worked happily by activating 'python hat.pyw'. However, I was
> unable to use py2exe to convert to an executable due to errors as
> attached at end of this message. I found out the scipy.plt module that
> caused the problem because py2exe will convert successfully if the
> codes that use scipy.plt are commented out.
> 
> Thank you.
> 
> Phil
> 
> 
> 
> Atatched py2exe error messages:
> 
> 
> 
> running py2exe
> running build
> running build_scripts
> not copying hat.pyw (up-to-date)
> running install_scripts
> not copying build\scripts\hat.pyw (output up-to-date)
> +----------------------------------------------------
> | Processing script hat.pyw with py2exe-0.2.6
> +----------------------------------------------------
> Searching modules needed to run 'hat.pyw' on path:
> ['C:\\Pho\\hat\\wxwin\\build\\bdist.win32\\winexe\\lib\\usr\\Python21',
> '', 'H:\\python\\Lib', 'C:\\usr\\Python21\\Pythonwin',
> 'C:\\usr\\Python21\\win32', 'C:\\usr\\Python21\\win32\\Lib',
> 'C:\\usr\\Python21', 'C:\\usr\\Python21\\DLLs',
> 'C:\\usr\\Python21\\lib', 'C:\\usr\\Python21\\lib\\plat-win',
> 'C:\\usr\\Python21\\lib\\lib-tk', 'C:\\usr\\Python21\\Numeric',
> 'C:\\usr\\Python21\\PPM']
> warning: install: modules installed to
> 'build\bdist.win32\winexe\lib\usr\Python21\', which is not in Python's
> module search path (sys.path) -- you'll have to change the search path
> yourself
> Traceback (most recent call last):
>   File "setup.py", line 14, in ?
>     scripts = ["hat.pyw"]
>   File "C:\usr\Python21\lib\distutils\core.py", line 138, in setup
>     dist.run_commands()
>   File "C:\usr\Python21\lib\distutils\dist.py", line 899, in
> run_commands
>     self.run_command(cmd)
>   File "C:\usr\Python21\lib\distutils\dist.py", line 919, in
> run_command
>     cmd_obj.run()
>   File "C:\usr\Python21\py2exe\py2exe.py", line 312, in run
>     mf.run_script(script)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 98, in
> run_script
>     self.load_module('__main__', fp, pathname, stuff)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 267, in
> load_module
>     self.scan_code(co, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 287, in
> scan_code
>     self.import_hook(name, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 110, in
> import_hook
>     q, tail = self.find_head_package(parent, name)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 151, in
> find_head_package
>     q = self.import_module(head, qname, parent)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 239, in
> import_module
>     m = self.load_module(fqname, fp, pathname, stuff)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 267, in
> load_module
>     self.scan_code(co, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 287, in
> scan_code
>     self.import_hook(name, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 110, in
> import_hook
>     q, tail = self.find_head_package(parent, name)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 151, in
> find_head_package
>     q = self.import_module(head, qname, parent)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 239, in
> import_module
>     m = self.load_module(fqname, fp, pathname, stuff)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 250, in
> load_module
>     m = self.load_package(fqname, pathname)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 324, in
> load_package
>     self.load_module(fqname, fp, buf, stuff)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 267, in
> load_module
>     self.scan_code(co, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 287, in
> scan_code
>     self.import_hook(name, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 110, in
> import_hook
>     q, tail = self.find_head_package(parent, name)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 151, in
> find_head_package
>     q = self.import_module(head, qname, parent)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 239, in
> import_module
>     m = self.load_module(fqname, fp, pathname, stuff)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 267, in
> load_module
>     self.scan_code(co, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 287, in
> scan_code
>     self.import_hook(name, m)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 110, in
> import_hook
>     q, tail = self.find_head_package(parent, name)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 151, in
> find_head_package
>     q = self.import_module(head, qname, parent)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 239, in
> import_module
>     m = self.load_module(fqname, fp, pathname, stuff)
>   File "C:\usr\Python21\py2exe\tools\modulefinder.py", line 254, in
> load_module
>     co = compile(fp.read()+'\n', pathname, 'exec')
>   File "<string>", line 30
>     """
> 
>        ^
> SyntaxError: invalid syntax



More information about the Python-list mailing list