Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#17 Can't execute py2exe

closed
nobody
None
5
2003-08-04
2003-07-19
Anonymous
No

I have the following setup.py file :
-------
from distutils.core import setup
from glob import glob
import py2exe
import sys

setup(name="pyut",
scripts=["pyut.pyw"],
)
-------

With python 2.2.3 and py2exe 0.3.4, I executed the
folowing command :
python setup.py py2exe

And got the following error :
running py2exe
running build
running vuild_scripts
not copying pyut.pyw(up-to-date)
running install scripts
not copying build\scripts-2.2\pyut.pyw (output up-to-
date)
+-----------------------------------------------------
---------------
| Processing script pyut.pyw with py2exe-0.3.4
+-----------------------------------------------------
---------------
Searching modules needed to run 'pyut.pyw' on path:
[...]
Traceback (...):
File "setup.py", line 20, in ?
script=["pyut.pyw"],
File "C:\PYTHON22\lib\distutils\core.py", line 138, in
setup
dist.run_commands()
File "E:\PYTHON\lib\distutils\dist.py", line 902, in
run_commands
self.run_command(cmd)
File "E:\PYTHON\lib\distutils\dist.py", line 922, in
run_command
cmd_obj.run()
File "E:\PYTHON\py2exe\build_exe.py", line 443, in run
mf.run_script(script)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
147, in run_script
self.load_module('__main__', fp, pathname, stuff)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
317, in load_module
self.scan_code(co, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
366, in scan_code
self.scan_code(c, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
337, in scan_code
self.import_hook(name, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
159, in import_hook
q, tail = self.find_head_package(parent, name)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
200, in find_head_package
q = self.import_module(head, qname, parent)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
287, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
317, in load_module
self.scan_code(co, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
337, in scan_code
self.import_hook(name, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
159, in import_hook
q, tail = self.find_head_package(parent, name)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
200, in find_head_package
q = self.import_module(head, qname, parent)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
287, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
317, in load_module
self.scan_code(co, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
366, in scan_code
self.scan_code(c, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
366, in scan_code
self.scan_code(c, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
337, in scan_code
self.import_hook(name, m)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
159, in import_hook
q, tail = self.find_head_package(parent, name)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
200, in find_head_package
q = self.import_module(head, qname, parent)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
287, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "E:\PYTHON\py2exe\tools\modulefinder.py", line
302, in load_module
co = compile(fp.read()+'\n', pathname, 'exec')
TypeError: compile() argument 1 must be string without
null bytes, not str

____

I have no idea of the origin of the bug, either python or
py2exe.
Can you help me ?
pleaaaaase !

C.Dutoit/PyUt (pyut.sf.net)

Discussion

  • Thomas Heller
    Thomas Heller
    2003-07-19

    Logged In: YES
    user_id=11105

    Can you find out what the value of 'pathname' is when the
    problem occurrs? It seems fp.read() doesn't contain source
    code...

     
  • Thomas Heller
    Thomas Heller
    2003-08-04

    Logged In: YES
    user_id=11105

    No feedback.

     
  • Thomas Heller
    Thomas Heller
    2003-08-04

    • status: open --> closed