I have a short python script, called test
:
import fiona
with fiona.open("C:\\Essai_compil", 'r') as l_Obs_shp:
for shp in l_Obs_shp:
print shp['geometry']
I want to compile with py2exe
or PyInstaller
. OS: Windows7, Python 2.7 (32-bits),
I've got erros. With py2exe
, the 'log.txt' said :
Traceback (most recent call last):
File "test.py", line 1, in <module>
File "fiona\__init__.pyc", line 78, in <module>
File "fiona\collection.pyc", line 7, in <module>
File "fiona\ogrext.pyc", line 12, in <module>
File "fiona\ogrext.pyc", line 10, in __load
ImportError: DLL load failed: %1 n’est pas une application Win32 valide.
ImportError: DLL load failed: %1 is not a valid Win32 application.
With PyInstaller
, log says:
File "ogrext.pyx", line 12 in init fiona.ogrext (src/fiona/ogrext.c:19107)
ImportError: cannot import name ogrinit
Problem are related to fiona
module or some ogr
stuff... I supposed this is not a 32/64 bits problem; all the modules I've used are 32-bits. More surely a DLL problem... Any ideas ?
Fiona
comes from here. I've choose v. 32 bits, for Python 2.7. I've copy theFiona
folder to OSGeo4W folder. PROBLEM: I've try to compile (withPy2exe
) a simple module to read a shapefile named test.py (withFiona
) and write shapes coordinates into a .csv named myfile.csv (withcsv
), here: # test.py module # import fiona import csv shp