The traffic library makes an intensive use of pandas DataFrames and of the shapely GIS library.

The library relies on requests for calls to REST APIs. paramiko implements the SSH protocol in Pure Python, giving access to SSH connection independently of the operating system.

Static visualisation tools are accessible with Matplotlib through the cartotools library, which leverages access to more projections and to data from OpenStreetMap. More dynamic visualisations in Jupyter Lab are accessible thanks to the altair and ipyleaflet libraries; other exports to various formats (including CesiumJS or Google Earth) are also available.


We recommend cloning the latest version from the repository before installing it.

git clone
cd traffic/
python install

If you are not comfortable with that option, you can always install the latest release:

pip install traffic


cartopy and shapely have strong dependencies to dynamic libraries which may not be available on your system by default. If possible, install Anaconda, then:

conda install cartopy shapely
# then _either_ with pip (stable version)
pip install traffic
# _or_ from sources (dev version)
python install


The following reported problems are not about the traffic library per se. Some are related to limitations set by dependencies.

I can’t access resources from the Internet as I am behind a proxy

All network accesses are made with the requests library (or the paramiko library for the Impala shell). Usually, if your environment variables are properly set, you should not encounter any particular proxy issue. However, there are always situations where it may help to manually force the proxy settings in the configuration file.

Edit your configuration file (you may find where it is located in traffic.config_file) and add the following section. Uncomment and edit options according to your network configuration.

## This sections contains all the specific options necessary to fit your
## network configuration (including proxy and ProxyCommand settings)

## input here the arguments you need to pass as is to requests
# http.proxy =
# https.proxy =
# http.proxy = socks5h://localhost:1234
# https.proxy = socks5h://localhost:1234

## input here the ProxyCommand you need to login to the Impala Shell
##    Do not use %h and %p wildcards.
##    Write and 2230 explicitly instead
# ssh.proxycommand = ssh -W proxy_ip:proxy_port
# ssh.proxycommand = connect.exe -H proxy_ip:proxy_port 2230

Python crashes when I try to reproduce plots in the documentation

(or, “My Jupyter kernel crashes…”)

There must be something wrong with your Cartopy and/or shapely installation. These libraries strongly depend on the geos and proj libraries. You must have shapely and Cartopy versions matching the correct versions of these libraries.

The problem is sometimes hard to understand, and you may end up fixing it without really knowing how.

If you don’t know how to install these dependencies, start with a fresh Anaconda distribution and install the following libraries the conda way:

conda install cartopy shapely

If it still does not work, try something along:

conda uninstall cartopy shapely
pip uninstall cartopy shapely
# be sure to remove all previous versions before installing again
conda install cartopy shapely

If it still does not work, try again with:

conda uninstall cartopy shapely
pip uninstall cartopy shapely
# this forces the recompilation of the packages
pip install --no-binary :all: cartopy shapely

Widgets do not display in Jupyter Lab or Jupyter Notebook

After executing a cell, you may see one of the following output:

A Jupyter Widget
# or
Error displaying widget
# or
HBox(children=(IntProgress(value=0, max=1), HTML(value='')))
# or
Map(basemap={'url': 'https://{s}…

You will need to activate the widgets extensions:

  • with Jupyter Lab:

    jupyter labextension install @jupyter-widgets/jupyterlab-manager
    jupyter labextension install jupyter-leaflet
    jupyter labextension install keplergl-jupyter
  • with Jupyter Notebook:

    jupyter nbextension enable --py --sys-prefix widgetsnbextension
    jupyter nbextension enable --py --sys-prefix ipyleaflet
    jupyter nbextension enable --py --sys-prefix keplergl