How to install Python geospatial libraries (Gdal, Fiona, Rasterio, etc) under a Conda Env in Windows
/Python is a great tool for spatial analysis and geomachine learning, however sometimes the Windows operating system presents some difficulties to install and run the bunch of Python libraries such as Gdal, Fiona, Geopandas, Rasterio. We are aware that most geoscientists, water resources specialists and related professionals work on Windows, therefore we are always in the search of new ways to get Python working with all its geospatial capabilities in every computer. We have created a tutorial that shows the installation process of the Python geospatial libraries in Windows by the use of a Conda environment; the process is simple on its steps, however the sequence and factors related to the package compatibility are important on the installation.
Main steps
Create a environment called “geo”:
conda create --name geo
Activate the new environment:
conda activate geo
Install all the geospatial libraries together with jupyterlab and pandas. This is the step where you have to add additional packages to ensure compatibility.
conda install -c conda-forge fiona shapely rasterio pyproj pandas jupyterlab
There are two ways to run jupyter lab
jupyter lab
python -m jupyterlab
When you want to get out of the environment:
conda deactivate
If you want to remove the environment:
conda env remove --name geo
List all remaining environments:
conda env list