Im trying to install GDAL latest version using pip, but im getting the following error, Failed building wheel for GDAL. My python version is 2.7.9, Please help me. It is installing gdal 1.11.3 version if i specify the version but i need latest version or >=2.0
Asked
Active
Viewed 4.9k times
26
-
maybe https://gist.github.com/cspanring/5680334 will help – Tomaž Bratanič Apr 24 '17 at 12:25
-
Ya, I tried it gives as follow gdal_wrap.cpp C:\Users\admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python \9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but un wind semantics are not enabled. Specify /EHsc extensions/gdal_wrap.cpp(3085) : fatal error C1083: Cannot open include file : 'cpl_port.h': No such file or directory error: command 'C:\\Users\\admin\\AppData\\Local\\Programs\\Common\\Microsof t\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2 – Satya Chandra Apr 24 '17 at 12:28
-
yea probably does not work on windows... try https://gis.stackexchange.com/questions/2276/installing-gdal-with-python-on-windows – Tomaž Bratanič Apr 24 '17 at 12:31
-
1Did you try to follow those instructions: https://pypi.python.org/pypi/GDAL ? – Olia Apr 24 '17 at 12:34
-
ya i followed and error as C:\GDAL-2.1.3\GDAL-2.1.3\extensions\gdal_wrap.cpp(3085) : fatal error C1083: Can not open include file: 'cpl_port.h': No such file or directory error: command 'C:\\Users\\admin\\AppData\\Local\\Programs\\Common\\Microsoft\\V isual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2 – Satya Chandra Apr 24 '17 at 12:51
-
Same error here VS2015/PythonTools missing cpl_port.h. C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I [a million include directories!!!] /EHsc /Tpextensions/gdal_wrap.cpp /Fobuild\temp.win-amd64-3.5\Release\extensions/gdal_wrap.obj gdal_wrap.cpp extensions/gdal_wrap.cpp(3168): fatal error C1083: Cannot open include file: 'cpl_port.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 – Bob Denny Oct 20 '17 at 16:12
1 Answers
39
Finally its worked with the command pip install C:\Users\admin\Downloads\GDAL-2.1.3-cp27-cp27m-win_amd64.whl.
I downloaded GDAL-2.1.3-cp27-cp27m-win_amd64.whl. from here http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal

Michael Hoffmann
- 2,411
- 2
- 24
- 42

Satya Chandra
- 728
- 2
- 12
- 26
-
6Still doesn't explain why gdal is missing required bits to build. How the heck did the famous "Golkhe" build it? But this is the way to get going, with Gohlke's WHL build – Bob Denny Oct 20 '17 at 16:15
-
4In my case, with Python version 3.6, this worked as well (of course with a different wheel file). – Reinier Jan 15 '19 at 17:02
-
2
-
-
1@norman123123: Oh, it is from the same URL. It has wheel files for several different Python versions and for Win32 as well as Win64. Just choose the one you need. – Reinier Jul 22 '20 at 06:46