akinuri
akinuri

Reputation: 12027

GDAL on Python 3.6.5 (64-bit)

I've been trying to install GDAL on Python 3.6.5 (64-bit) on Windows for the past hour, and nothing works.

I've visited some questions on SO, watched a video on YT, but none of them applies to my situation (which there's nothing special about it).

Can someone provide a step-by-step solution, preferably a tested one, so I can figure out what exactly I'm doing wrong?

I'm willing provide any OS setting info/screenshot if necessary.


Update: I'm trying to install GDAL to convert TIF (16-bit) files to JPG or PNG. Although I managed to install GDAL with the second method (at second try), I could not use gdal_translate. So not every GDAL lib/version works for me.


First method:


Second method:


I'll be updating this with the methods I've tried.

Upvotes: 1

Views: 5720

Answers (1)

the_cheff
the_cheff

Reputation: 5040

The prebuild GDAL version from conda-forge works great on windows 64 bit python 3.6.5

You can install Anaconda (or Miniconda)

After installing Anaconda, I usually use the Anaconda prompt instead of the regular windows command prompt.

(Optional) If you would like to isolate this in a specific environment

I would recomend using environments with anaconda so create some environment like this

conda create --name gdal_env python=3.6.5

activate gdal_env

Environments are not required, so you can skip this step and continue to installing gdal.

Install gdal

conda install -c conda-forge gdal

I have found conda-forge to be the (by far) easiest way to install GDAL on windows. If for some reason you are required to use another python distribution, i have found the prebuild binaries from here to work fine too https://www.lfd.uci.edu/~gohlke/pythonlibs/ if you follow this guide

Upvotes: 2

Related Questions