pythonmapboxpydeck

Mapbox API key issue


After installing pydeck, I set the MAPBOX_ACCESS_TOKEN:

export 
MAPBOX_ACCESS_TOKEN=pk.eyJ1Ijoibmlrb2dhbXVsaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlRyMZPMp4ASJ0yyA

When I run jupyter notebook in which I try to display a map, however, I get a warning:

UserWarning: Mapbox API key is not set. This may impact available features of pydeck.

does anyone know how to correctly setup the mapbox access token for pydeck?


Solution

  • Can you share how you initialize Deck?

    Do you pass the Mapbox API key as parameter when setting up Deck?

    Deck(layers=None, views=[{"@@type": "MapView", "controller": true}], map_style='dark', api_keys=None, initial_view_state={"latitude": 0, "longitude": 0, "zoom": 1}, width='100%', height=500, tooltip=True, description=None, effects=None, map_provider='carto', parameters=None)
    

    For reference see: https://deckgl.readthedocs.io/en/latest/deck.html#pydeck.bindings.deck.Deck