Skip to content

Building doc directory - mapbox_token needed #3483

Closed

Description

@magic-lantern

I'm wanting to build a version of plotly for offline use - specifically the documentation.

When I follow the very simple directions provided at https://github.com/plotly/plotly.py/tree/master/doc I do the following:

  1. git clone git@github.com:plotly/plotly.py.git
  2. cd plotly.py/doc
  3. conda create -n plotly_docs python=3.8 pip
  4. conda activate plotly_docs
  5. pip install -r requirements.txt
  6. make

I get the following error:

make: *** No rule to make target 'python/.mapbox_token', needed by 'build/ipynb/.mapbox_token'.  Stop.

I'm not able to find information about mapbox_token.

Activity

  1. magic-lantern commented on Nov 22, 2021

    @magic-lantern
    ContributorAuthor

    Clarifying my comment - perhaps this should be a separate issue?

    I'm most interested in an older version of plotly python library.

    In the github version, removing the mapbox section from Makefile:

    $(IPYNB_DIR)/.mapbox_token: $(MD_DIR)/.mapbox_token
    	@mkdir -p $(IPYNB_DIR)
    	@echo "[symlink]    .mapbox_token"
    	@cd $(IPYNB_DIR) && ln -s ../../$<
    
    $(IPYNB_FILES): $(IPYNB_DIR)/.mapbox_token

    Appears to allow almost everything to build correctly. Dies at notebooks that require mapbox.

    [jupytext]   python/hexbin-mapbox.md
    [nbconvert]  build/ipynb/hexbin-mapbox.ipynb
    Makefile:30: recipe for target 'build/html/2019-07-03-hexbin-mapbox.html' failed
    make: *** [build/html/2019-07-03-hexbin-mapbox.html] Error 1
    

    However in older versions If I comment out/remove the mapbox_token section, running make dies almost immediately with the error TypeError: 'coroutine' object is not subscriptable

    I'm not sure if this is due to mapbox portions not working or other error that is different. I suspect that the problem is due to some version mismatch of other software (Jupyter, Python, etc.)

  2. nicolaskruchten commented on Nov 22, 2021

    @nicolaskruchten
    Contributor

    The contents of .mapbox_token should just be a valid mapbox.com token. It's just a matter of signing up and getting a free token :)

  3. magic-lantern commented on Nov 23, 2021

    @magic-lantern
    ContributorAuthor

    Thanks @nicolaskruchten !

    I created a free account, then copied my "Default public token" to the file <gitrepo>/doc/python/.mapbox_token then ran make

    While the build is still running, it seems to be working so far.

    As this step seems to be missing from the docs (or at least is not in the README.md) I've created a fork and made a minor documentation update pull request. Will push shortly.

  4. added 2 commits that reference this issue on Nov 23, 2021
  5. rabyj commented on Feb 2, 2023

    @rabyj

    I stumbled on this when also looking to create offline doc (for Zeal). The doc was enough to fix my problem, thanks to the doc fix by @magic-lantern. I think the issue can be closed @nicolaskruchten

  6. magic-lantern commented on Feb 2, 2023

    @magic-lantern
    ContributorAuthor

    Guess I forgot about this. Since they already merged my documentation fix, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions