carpentries-incubator / geospatial-python

Introduction to Geospatial Raster and Vector Data with Python
https://carpentries-incubator.github.io/geospatial-python/
Other
159 stars 57 forks source link

Geospatial Installation Instructions Page #3

Closed rbavery closed 3 years ago

rbavery commented 5 years ago

Installing geospatial python packages has always proven to be more difficult for me than the rest, so clear guidelines on how to install all the required packages are needed, (similar to the R geospatial lesson).

I've tried this by using pip with the hope it would work out, but not so:

.
.
.
OSError: Could not find libspatialindex_c library file

This is a common issue across libraries like geopandas and rasterio and the recommended suggestion is usually to install from conda-forge. But, I've run into environment inconsistency issues when installing packages in a base environment with a mix of conda-forge, conda, and pip packages, and seen these same issues pop up with others that work with different OSes (Mac, Windows, Ubuntu).

A quick fix for me has been to uninstall all user installed packages and then install all the necessary packages from conda-forge. So maybe something like this could be the recommended instruction if an initial install attempt doesn't work:

The first line removes all user installed packages, from this post: https://stackoverflow.com/questions/52830307/conda-remove-all-installed-packages-from-base-root-environment

conda install --revision 0
conda install -c conda-forge earthpy geopandas rasterio jupyterlab scipy numpy matplotlib pandas seaborn scikit-image dask xarray ipyleaflet
dvanic commented 5 years ago

Hi Ryan, Sorry it's taken me so long to get to this!

  1. Why are you suggesting using the base environment for the lesson at all???
  2. Why not create a virtual environment using conda straight off the bat?
rbavery commented 5 years ago

Hey @dvanic thanks for the review and comment! I'll get to your other comments on the PR this week.

I don't think it is standard for lessons to use conda environments, but I think that's a good idea in this case. I'm all for using conda environments, especially for geospatial dependencies. I think we can give learners the environment file from the lesson page and the line to install, conda env install -f environment.yml, in the interest of keeping the lesson focused on geospatial python.