From: Luis Quesada on
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(a)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(a)lquesada-laptop:~/workspace/MetroNode/src/models$

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

lquesada(a)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'
From: Lawrence D'Oliveiro on
In message <kZ4xn.868$I8.457(a)news.indigo.ie>, Luis Quesada wrote:

> I am getting an "expected string without null bytes" error when using
> cxfreeze for creating a standalone application (in Linux-Ubuntu).

Why bother? Every decent Linux system will have Python available. Why not
just distribute it as a script?
From: Luis Quesada on
Lawrence D'Oliveiro wrote:
> In message <kZ4xn.868$I8.457(a)news.indigo.ie>, Luis Quesada wrote:
>
>> I am getting an "expected string without null bytes" error when using
>> cxfreeze for creating a standalone application (in Linux-Ubuntu).
>
> Why bother? Every decent Linux system will have Python available. Why not
> just distribute it as a script?

Well every decent Linux system will have Java available too but it is
still preferable to distribute jar files. The point is that I don't want
to force my users to install all the packages that I had to install.
Cheers,
Luis
From: Gabriel Genellina on
En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada <l.quesada(a)4c.ucc.ie>
escribi�:

> 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.

Are you sure? A text file saved as, e.g., UTF-16, does contain null bytes.

> cxfreeze's output
> ...
> 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

I would add a few 'print' statements in finder.py to determine which file
is failing.

--
Gabriel Genellina

From: Jonathan Hartley on
On Apr 13, 10:42 pm, Lawrence D'Oliveiro <l...(a)geek-
central.gen.new_zealand> wrote:
> In message <kZ4xn.868$I8....(a)news.indigo.ie>, Luis Quesada wrote:
>
> > I am getting an "expected string without null bytes" error when using
> > cxfreeze for creating a standalone application (in Linux-Ubuntu).
>
> Why bother? Every decent Linux system will have Python available. Why not
> just distribute it as a script?

I keep hearing this reply every time I ask this question, and it
doesn't seem to make sense to me.

Anything other than a trivial script will have dependencies. These
might be other Python packages, C-extensions, and other libraries.
What if your program runs on a version of Python other than the one
installed on the client's Linux system?

In my opinion, there is a severe need for this question to be answered
in a robust and simple way. Is creating an rpm / deb file the answer?
I don't know, but I think it's a very valid question.
 |  Next  |  Last
Pages: 1 2
Prev: Python, CGI and Sqlite3
Next: mailbox multipart