Hi all,

I'm trying to package my Python program up into an executable using 
py2exe, so that users can run the exe without having to install (or know 
anything about) Python.

I'm stumbling over shapely\ctypes_declarations.py, which just isn't 
included in the py2exe distribution, causing a runtime error when I 
execute my .exe:

IOError: [Errno 2] No such file or directory: 'C:\\Documents and 
Settings\\jhartley\\My 
Dropbox\\projects\\solescion\\dist\\SoleScion-win-binary-0.2.6-svn\\exe\\library.zip\\shapely\\ctypes_declarations.py'
Traceback (most recent call last):
  File "main.py", line 5, in <module>
  File "solescion\controller\application.pyo", line 6, in <module>
  File "solescion\controller\gameloop.pyo", line 10, in <module>
  File "solescion\controller\graphics.pyo", line 5, in <module>
  File "solescion\geom\svgload\svg_parser.pyo", line 4, in <module>
  File "shapely\geometry\__init__.pyo", line 1, in <module>
  File "shapely\geometry\geo.pyo", line 5, in <module>
  File "shapely\geometry\point.pyo", line 10, in <module>
  File "shapely\geos.pyo", line 56, in <module>
IOError: [Errno 2] No such file or directory: 'C:\\Documents and 
Settings\\jhartley\\My 
Dropbox\\projects\\solescion\\dist\\SoleScion-win-binary-0.2.6-svn\\exe\\library.zip\\shapely\\ctypes_declarations.py'

I tried manually copying /ctypes_declaration.py/ from Shapely directory 
into py2exe's library.zip, but I still get the same error on running, 
much to my puzzlement. Presumably I could tweak my /setup.py/ to include 
ctypes_declaration.py automatically, (and I will try this) but I don't 
see how that will help if the manual copy has had no effect.

Am I doing it very wrong? Does anyone have a recipe or working example 
of using Shapely with py2exe?

Sorry if this is covered somewhere, I've been Googling but to no avail.

Shapely is installed in a virtualenv (which is active) and the 
libgeos.dll is included in the py2exe executable by adding the following 
to my setup.py:

        data_files = [
            ('', ['solescion/lib/geos.dll']),
            ('', ['solescion/lib/libgeos-3-0-0.dll']),
        ],

Thanks for any pointers,

    Jonathan

-- 
Jonathan Hartley      Made of meat.      http://tartley.com
[email protected]   +44 7737 062 225   twitter/skype: tartley


_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to