Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building doc directory - mapbox_token needed #3483

Closed
magic-lantern opened this issue Nov 22, 2021 · 5 comments
Closed

Building doc directory - mapbox_token needed #3483

magic-lantern opened this issue Nov 22, 2021 · 5 comments

Comments

@magic-lantern
Copy link
Contributor

magic-lantern commented Nov 22, 2021

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 [email protected]: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.

@magic-lantern
Copy link
Contributor Author

magic-lantern commented Nov 22, 2021

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.)

@nicolaskruchten
Copy link
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 :)

@magic-lantern
Copy link
Contributor Author

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.

magic-lantern added a commit to magic-lantern/plotly.py that referenced this issue Nov 23, 2021
Build requires a mapbox token, but did not mention that in the documentation. This should help with issue plotly#3483
magic-lantern added a commit to magic-lantern/plotly.py that referenced this issue Nov 23, 2021
Adding setup details for mapbox token to help with plotly#3483
@rabyj
Copy link

rabyj commented Feb 2, 2023

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

@magic-lantern
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants