python-3.xgeopandascontextily

How to install Contextily?


This question is written in relation with the answer to Plotting a map using geopandas and matplotlib.

The main point is that installing (spatial) libraries such as Proj.4 or Contextily can be a confusing task under Windows, so that most of the time we are advised to directly

use the OSGeo4W software distribution.

An example of such an advise here.

A contrario, the task is rather easy with other operating systems.


The main idea is to provide interrogative users with a "lite" installation approach.


Solution

  • Using Anaconda / conda

    If you are using the Anaconda distribution or in general the conda package manager (which I recommend for installing the python geo stack), it should suffice to install contextily with:

    conda install contextily --channel conda-forge
    

    This will automatically install all python and C dependencies (proj.4, GDAL, ...)

    This should work on all platforms (Windows, Linux, Mac).