Creating a standalone application

Luis Quesada l.quesada at 4c.ucc.ie
Tue Apr 13 17:02:07 EDT 2010


Dear all,
I am getting an "expected string without null bytes" error when using 
cxfreeze for creating a standalone application (in Linux-Ubuntu). None 
of my files has null bytes. I also tried pyinstaller but I got the error 
  attached at the end.
My program runs fine when executed from eclipse.  What is the easiest 
way of creating a standalone application? Is there a way of creating the 
executable file from eclipse/pydev?
Cheers,
Luis



cxfreeze's output
lquesada at lquesada-laptop:~/workspace/MetroNode/src/models$ cxfreeze 
uncovered.py --target-dir dist
copying /usr/lib/pymodules/python2.6/cx_Freeze/bases/Console -> 
dist/uncovered
copying /usr/lib/libpython2.6.so.1.0 -> dist/libpython2.6.so.1.0
Traceback (most recent call last):
   File "/usr/bin/cxfreeze", line 5, in <module>
     main()
   File "/usr/lib/pymodules/python2.6/cx_Freeze/main.py", line 170, in main
     freezer.Freeze()
   File "/usr/lib/pymodules/python2.6/cx_Freeze/freezer.py", line 405, 
in Freeze
     self._FreezeExecutable(executable)
   File "/usr/lib/pymodules/python2.6/cx_Freeze/freezer.py", line 173, 
in _FreezeExecutable
     exe.copyDependentFiles, scriptModule)
   File "/usr/lib/pymodules/python2.6/cx_Freeze/freezer.py", line 333, 
in _WriteModules
     initModule = finder.IncludeFile(initScript, "cx_Freeze__init__")
   File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 386, in 
IncludeFile
     deferredImports)
   File "/usr/lib/pymodules/python2.6/cx_Freeze/finder.py", line 259, in 
_LoadModule
     module.code = compile(fp.read() + "\n", path, "exec")
TypeError: compile() expected string without null bytes
lquesada at lquesada-laptop:~/workspace/MetroNode/src/models$

======================================================================
pyinstaller's output

lquesada at lquesada-laptop:~/workspace/MetroNode/src/models$ python 
~/pyinstaller-1.4/Build.py uncovered.spec
checking Analysis
building Analysis because outAnalysis0.toc non existent
running Analysis outAnalysis0.toc
Analyzing: /home/lquesada/pyinstaller-1.4/support/_mountzlib.py
Analyzing: /home/lquesada/pyinstaller-1.4/support/useUnicode.py
Analyzing: uncovered.py
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_conflict.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_nodesel.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_vars.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_heur.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_branch.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_sepa.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_prop.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_presol.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_soln.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_cons.so: 
No such file or directory
ldd: 
/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_scip.so: 
No such file or directory
Warnings written to 
/home/lquesada/workspace/MetroNode/src/models/warnuncovered.txt
checking PYZ
rebuilding outPYZ1.toc because outPYZ1.pyz is missing
building PYZ outPYZ1.toc
checking PKG
rebuilding outPKG3.toc because outPKG3.pkg is missing
building PKG outPKG3.pkg
Cannot find ('zibopt._conflict.so', 
'/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_conflict.so', 
1, 'b')
Traceback (most recent call last):
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 1160, in <module>
     main(args[0], configfilename=opts.configfile)
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 1148, in main
     build(specfile)
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 1111, in build
     execfile(spec)
   File "uncovered.spec", line 14, in <module>
     console=1 )
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 661, in __init__
     strip_binaries=self.strip, upx_binaries=self.upx, crypt=self.crypt)
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 561, in __init__
     self.__postinit__()
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 196, in __postinit__
     self.assemble()
   File "/home/lquesada/pyinstaller-1.4/Build.py", line 618, in assemble
     archive.build(self.name, mytoc)
   File "/home/lquesada/pyinstaller-1.4/archive.py", line 229, in build
     self.add(tocentry)   # the guts of the archive
   File "/home/lquesada/pyinstaller-1.4/carchive.py", line 235, in add
     s = open(pathnm, 'rb').read()
IOError: [Errno 20] Not a directory: 
'/usr/local/lib/python2.6/dist-packages/python_zibopt-0.5.beta_r97-py2.6-linux-i686.egg/zibopt/_conflict.so'



More information about the Python-list mailing list