Opened 8 years ago

Closed 8 years ago

#6364 closed defect (fixed)

Unable to package Python GDAL

Reported by: geojulien Owned by: hobu
Priority: normal Milestone: 2.0.3
Component: PythonBindings Version: unspecified
Severity: normal Keywords:
Cc:

Description

I created a portable executable with py2exe but executing it I've got that issue:

Traceback (most recent call last):
  File "DicoGIS.py", line 55, in <module>
  File "osgeo\gdal.pyo", line 472, in <module>
  File "osgeo\ogr.pyo", line 486, in <module>
  File "osgeo\ogr.pyo", line 454, in __init__
NameError: global name 'help' is not defined

Looking for a referenced solution, I found out this GitHub issue on the PyInstaller (an alternative to py2exe): https://github.com/pyinstaller/pyinstaller/issues/1522#issuecomment-143382875

Working on Windows, I installed the last package from Christoph Gohlke website (http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal): 2.0.2 with CPython 2.7.11, inside a venv.

Change History (4)

comment:1 by Even Rouault, 8 years ago

I guess this should be rather directed to py2exe / pyinstaller maintainers so they can advise if there is anything wrong in the GDAL Python bindings, or if they can improve their software to cope with it.

comment:2 by giumas, 8 years ago

I have the same issue using anaconda packages (so it should not be related to the use of the Gohlke wheel).

comment:3 by giumas, 8 years ago

Since it is most likely related to the hacking approach described here: http://erouault.blogspot.com/2014/11/hacking-python-module-constants.html , I am afraid that py2exe / pyinstaller maintainers will not easily accept to dig into the issue and support it.

This can be a relevant obstacle to adopt GDAL >2.0 for all the Python applications that use GDAL and want to maintain a freezing option. As far as I know, there are not freezing tools able to freeze an application with a GDAL >2.0 dependency.

comment:4 by Even Rouault, 8 years ago

Resolution: fixed
Status: newclosed

Well, I'm not too keen to dig into py2exe/pyinstaller to understand why they don't like the trick, so I've juste reverted this as the warning was just in the nice-to-have category.

trunk r33541, branches2.0 r33542 "Python bindings: disable the warning about using deprecated wkb25DBit constant as it uses a trick that prevents the bindings from being used by py2exe / pyinstaller (#6364)"

Note: See TracTickets for help on using tickets.