[gdal-dev] How to build python bindings on windows?
even.rouault at mines-paris.org
Sun Jan 8 16:03:26 EST 2012
Le dimanche 08 janvier 2012 21:44:58, Joaquim Luis a écrit :
> I made my first attempt to build the python bindings on Windows and
> like others have complained before ... nothing happened
> I did set PYDIR and PY_INST_DIR but at the end no errors nor anything
> else python related.
> Next I went to swig\python and did
> python.exe setup.py build
> which resulted in
> copying osgeo\osr.py -> build\lib.win32-2.6\osgeo
> copying osgeo\__init__.py -> build\lib.win32-2.6\osgeo
> running build_ext
> building 'osgeo._gdal' extension
> error: Unable to find vcvarsall.bat
> why the hell is it looking for vcvarsall.bat (the VS batch that sets
> necessary env variables)? And who is doing that? I grepped for vcvarsall
> and nothing showed up.
Generally, to build Python extensions on Widnows, you need to use the same
version of MSVC that was used to compile your Python binary. For python 2.6, I
believe that the provided binaries are compiled with MSVC 2008 for example.
If you have not that version, then you can probably hack distutils script to
convince them to use whatever version of MSVC you have. Or you can rebuild
python with the msvc version you have.
I'm not sure what Tamas did with its SDKs ( http://vbkto.dyndns.org/sdk/ :
seems to be down just now ) where he manages to provide the Python bindings on
various MSVC versions.
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
More information about the gdal-dev