There are three steps before using pydeck:
Install the library via pip or conda
Get a Mapbox API token
Enable pydeck for JupyterLab or Jupyter Notebook
conda install -c conda-forge pydeck
Getting a Mapbox API key¶
Mapbox tiles are free for a rather high level of usage. You can learn more about Mapbox tokens via their documentation.
If you set a
MAPBOX_API_KEY environment variable, pydeck will detect it. This way, you do not
need to specify the Mapbox token in your source code.
Enabling pydeck for Jupyter¶
Jupyter allows for more complex server/client interactions. You or your system administrator must enable pydeck for use in Jupyter. Binary data transportation, data selection, and updating data over time interactively only work if pydeck is enabled for use in a Jupyter environments.
To enable pydeck for Jupyter Notebook:
jupyter nbextension install --sys-prefix --symlink --overwrite --py pydeck jupyter nbextension enable --sys-prefix --py pydeck
To enable pydeck for JupyterLab:
jupyter labextension install @jupyter-widgets/jupyterlab-manager DECKGL_SEMVER=`python -c "import pydeck; print(pydeck.frontend_semver.DECKGL_SEMVER)"` jupyter labextension install @deck.gl/jupyter-widget@$DECKGL_SEMVER
Currently while you can install pydeck in Google Colab via pip, it is not enabled for server use there.
Installing from source¶
If you want to install the library from its source:
git clone https://github.com/uber/deck.gl cd deck.gl/bindings/pydeck make pre-init . env/bin/activate make init make prepare-jupyter
You can run the local tests to verify that the installation worked via
Please note that if you are installing a pydeck prerelease, you may have to specify a specific version
@deck.gl/jupyter-widget to install for JupyterLab. You can read this version from pydeck itself.
DECKGL_SEMVER=`python -c "import pydeck; print(pydeck.frontend_semver.DECKGL_SEMVER)"` jupyter labextension install @deck.gl/jupyter-widget@$DECKGL_SEMVER