Re: Creating a standalone application

2010-04-17 Thread Lawrence D'Oliveiro
In message fbdf4a20-1fe2-4c23-9ee2-
c6e739362...@12g2000yqi.googlegroups.com, Jonathan Hartley wrote:

 On Apr 13, 10:42�pm, Lawrence D'Oliveiro
 l...@geek-central.gen.new_zealand wrote:

 In message kz4xn.868$i8@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?
 
 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?

Let the distro maintainers worry about that. They will package your code up 
in the appropriate form, so that the system package manager will 
automatically ensure that the right dependencies are present. Problem 
solved, no need to keep reinventing the wheel.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-17 Thread Lawrence D'Oliveiro
In message 4bc4ec17.3040...@4c.ucc.ie, Luis Quesada wrote:

 Lawrence D'Oliveiro wrote:

 In message kz4xn.868$i8@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 ...

Questionable. Java doesn’t seem to be of much importance in the mass market, 
it seems to be primarily for corporate use.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-14 Thread Jonathan Hartley
On Apr 13, 10:42 pm, Lawrence D'Oliveiro l...@geek-
central.gen.new_zealand wrote:
 In message kz4xn.868$i8@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.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-14 Thread Luis Quesada
On Apr 14, 6:31 am, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
 En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada l.ques...@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.


I did what you suggested: I modified finder.py so that it prints the
name of the module before the compile statement that triggers the
exception. This is what I get now:

lques...@lquesada-laptop:~/workspace/MetroNode/src/models$ cxfreeze
uncovered.py --target-dir dist
compiling os
compiling posixpath
compiling stat
compiling genericpath
compiling warnings
compiling linecache
compiling types
compiling re
compiling sre_compile
compiling sre_parse
compiling sre_constants
compiling copy_reg
compiling UserDict
compiling _abcoll
compiling abc
compiling copy
compiling repr
compiling subprocess
compiling traceback
compiling threading
compiling functools
compiling _strptime
compiling locale
compiling encodings
compiling codecs
compiling encodings.aliases
compiling calendar
compiling optparse
compiling textwrap
compiling string
compiling gettext
compiling struct
compiling StringIO
compiling token
compiling tokenize
compiling dummy_thread
compiling collections
compiling keyword
compiling doctest
compiling __future__
compiling inspect
compiling dis
compiling opcode
compiling unittest
compiling getopt
compiling difflib
compiling heapq
compiling bisect
compiling pdb
compiling cmd
compiling bdb
compiling pprint
compiling shlex
compiling tempfile
compiling random
compiling _threading_local
compiling pickle
compiling __main__
compiling Numberjack
compiling Decomp
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
compiling cx_Freeze__init__
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 387,
in IncludeFile
deferredImports)
  File /usr/lib/pymodules/python2.6/cx_Freeze/finder.py, line 260,
in _LoadModule
module.code = compile(fp.read() + \n, path, exec)
TypeError: compile() expected string without null bytes

Now I even more confused since it seems the problem is taking place
when trying cx_Freeze__init__ 
Cheers,
Luis
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-14 Thread Gabriel Genellina
En Wed, 14 Apr 2010 06:10:59 -0300, Luis Quesada  
luis.omar.quesada.rami...@gmail.com escribió:



On Apr 14, 6:31 am, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada l.ques...@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.



This is what I get now:
...
compiling cx_Freeze__init__
Traceback (most recent call last):
  ...
  File /usr/lib/pymodules/python2.6/cx_Freeze/finder.py, line 260,
in _LoadModule
module.code = compile(fp.read() + \n, path, exec)
TypeError: compile() expected string without null bytes

Now I even more confused since it seems the problem is taking place
when trying cx_Freeze__init__ 


Yes, looks like a problem within cx_Freeze itself. Sorry, I cannot be of  
more help, I don't use the tool myself.


Try asking in the project's mailing list  
http://cx-freeze.sourceforge.net, I think you may get more specific help  
there. (Also, try using the latest cx_Freeze release, this may have been  
already fixed).


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-14 Thread Luis Quesada
On Apr 14, 11:06 am, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
 En Wed, 14 Apr 2010 06:10:59 -0300, Luis Quesada  
 luis.omar.quesada.rami...@gmail.com escribió:



  On Apr 14, 6:31 am, Gabriel Genellina gagsl-...@yahoo.com.ar
  wrote:
  En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada l.ques...@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.
  This is what I get now:
  ...
  compiling cx_Freeze__init__
  Traceback (most recent call last):
    ...
    File /usr/lib/pymodules/python2.6/cx_Freeze/finder.py, line 260,
  in _LoadModule
      module.code = compile(fp.read() + \n, path, exec)
  TypeError: compile() expected string without null bytes

  Now I even more confused since it seems the problem is taking place
  when trying cx_Freeze__init__ 

 Yes, looks like a problem within cx_Freeze itself. Sorry, I cannot be of  
 more help, I don't use the tool myself.

 Try asking in the project's mailing list  
 http://cx-freeze.sourceforge.net, I think you may get more specific help  
 there. (Also, try using the latest cx_Freeze release, this may have been  
 already fixed).


Thanks Gabriel. I will try cx-freeze's mailing list.
Cheers
Luis
-- 
http://mail.python.org/mailman/listinfo/python-list


Creating a standalone application

2010-04-13 Thread Luis Quesada

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
lques...@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
lques...@lquesada-laptop:~/workspace/MetroNode/src/models$

==
pyinstaller's output

lques...@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 , 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

Re: Creating a standalone application

2010-04-13 Thread Lawrence D'Oliveiro
In message kz4xn.868$i8@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?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-13 Thread Luis Quesada

Lawrence D'Oliveiro wrote:

In message kz4xn.868$i8@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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Creating a standalone application

2010-04-13 Thread Gabriel Genellina
En Tue, 13 Apr 2010 18:02:07 -0300, Luis Quesada l.ques...@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

--
http://mail.python.org/mailman/listinfo/python-list