More Ways to Install GDAL in Windows
Table of contents:
This article is an extension to the GDAL installation guide I published earlier on the SatSure blog.
License: This article is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
Many approached me with concerns that those mentioned in the earlier article were not working in their system. The problem often was happening with Windows users as its straightforward process in Linux and Mac. The issues were mostly due to the following reasons:
- Multiple versions of python available in the system.
- The python version and the GDAL version is not the matching.
- Lack of adding environment variables.
- Incomplete installation of modules.
- GDAL core and GDAL python binder were of different versions.
I recommend everyone to remove all the python and GDAL versions already installed from your system before retrying these methods.
Many GDAL users will have also ArcGIS installed in the system. Those who have installed ArcGIS, should not remove python 2.7 (Python27 folder outside Program files). Entire ArcGIS architecture is build on python 2.7 and removing it will endup in crashing your ArcGIS, instead insall it in a seperate location
Install with whl file
Christoph Gohlke from University of California, Irvine has hosted a website of unofficial Windows Binaries for Python Extension Packages. The webpage contains 32 and 64-bit Windows binaries of many scientific open-source extension packages for the official CPython distribution of the Python. The GDAL whl file can also be obtained from here.
-
Download the GDAL whl file from the website.
-
Check the GDAL version and system architecture from the file name and download the appropriate file.
- Say suppose file name is
GDAL‑3.3.0‑cp310‑cp310‑win_amd64.whl
it means the file is GDAL with version 3.3.0 with windows 64 bit architecture.
Note: Read more on python tag before downloading cp file or pp file. Normally cp file goes well with pip.
- Say suppose file name is
-
Use pip command to install the file:
pip install path_to_file\file_name.whl
- Say
pip install C:\downloaded\GDAL‑3.3.0‑cp310‑cp310‑win_amd64.whl
- Say
Note: If GDAL is installed using whl file there is no need of installing the GDAL python binder and GDAL core.
If you get an error indicating the pip module is missing or anything similar it may be of two reasons. Either the pip path is not given in the Environment Variable or there are multiple pip in the system. Refer the python installation in previous tutorial to for this.
GDAL core msi not found in GIS internals ?
This is the major cocern of many people who had approached me that they dont find the GDAL core in the GIS internals webpage to download. The GIS internals' stable release page has their latest stable version of GDAL and the corresponding python binder is published. This often creates confusion and sometimes the core’s msi file may not be listed in the page as the core may not have any updates and remains the same. In that case search the core file in the archives page by clicking the older releases option from the download tab.
- Select the compiler (say Microsoft Visual C++ (MSVC) 2017) and architecture from the table.
- Download the GDAL core msi file and corresponding version of the python binder.
- Follow the GDAL installation steps from the previous tutorial.
Any Comments on the article? Let me know @arkarjun.