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

Handler for event 'builder-inited' threw an exception for npm #3028

Closed
capac opened this issue Apr 21, 2023 · 9 comments
Closed

Handler for event 'builder-inited' threw an exception for npm #3028

capac opened this issue Apr 21, 2023 · 9 comments

Comments

@capac
Copy link

capac commented Apr 21, 2023

Hello,
I've been trying to compile the docs for Altair 4.2.2, and after installing all necessary packages, I hit the error message:

Extension error (sphinxext.altairgallery):
Handler <function main at 0x154494160> for event 'builder-inited' threw an exception (exception: Command '['/usr/local/Caskroom/miniconda/base/envs/docs/bin/npm', 'bin', '--global']' returned non-zero exit status 1.)
make: *** [html] Error 2

I've also tried with Altair 5.0 RC1 but after installing all of the necessary packages I receive the exact same error message. I tried installing the vega-lite, vega-cli and canvas packages with npm, even though had already been installed with conda, but the error is the same.

npm install -g --force vega-lite vega-cli canvas

Any suggestions?

Angelo

@mattijn
Copy link
Contributor

mattijn commented Apr 21, 2023

Did you follow these instructions: https://github.com/altair-viz/altair/blob/master/CONTRIBUTING.md#building-the-documentation-locally to install the docs locally for Altair 5.0rc1?

I'm not sure what your intend is for the docs of Altair 4.2.2, but I think we are focusing documentation updates to newer releases.

@capac
Copy link
Author

capac commented Apr 21, 2023

Thanks for the help, I've been able to successfully compile the Altair 5.0.0 RC1 docs. My intent is to create documentation for Dash for Altair 4.2.2 and 5.0.

@mattijn
Copy link
Contributor

mattijn commented Apr 21, 2023

Nice! That would be great, good luck! I assume I can close this issue, otherwise you can reopen it again.

@mattijn mattijn closed this as completed Apr 21, 2023
@capac
Copy link
Author

capac commented Apr 21, 2023

Actually I've noticed just now an issue with the docs at 'Installation — Vega-Altair 5.0.0dev documentation'. The following .. code-block:: bash placeholder appears where code should be (see attachment). The same of course appears in the Dash docs.

Screen Shot 2023-04-21 at 15 57 39

@capac
Copy link
Author

capac commented Apr 21, 2023

Did you follow these instructions: https://github.com/altair-viz/altair/blob/master/CONTRIBUTING.md#building-the-documentation-locally to install the docs locally for Altair 5.0rc1?

I'm not sure what your intend is for the docs of Altair 4.2.2, but I think we are focusing documentation updates to newer releases.

I still wish to make docs for Altair 4.2.2 for Dash. On the 4.2.2 tag the hatch commands don't work, and I still don't know how to overcome the error I referenced above, which are produced with make html in the doc directory:

Extension error (sphinxext.altairgallery):
Handler <function main at 0x154494160> for event 'builder-inited' threw an exception (exception: Command '['/usr/local/Caskroom/miniconda/base/envs/docs/bin/npm', 'bin', '--global']' returned non-zero exit status 1.)
make: *** [html] Error 2

@binste
Copy link
Contributor

binste commented Apr 23, 2023

Prior to Altair 5 we use altair_saver to generate the thumbnails in the Example Gallery of the docs. I assume the error comes from that package. See https://github.com/altair-viz/altair_saver/ for more detailed installation instructions.

Maybe you get a more helpful error message if you try to save a single Altair chart with altair_saver in a Jupyter notebook or other interactive environment? What OS are you working on and if it's a Mac, what kind of chip (Intel, M1, M2, ...)? Do you have experience working with Docker containers? In that case I could write a Dockerfile with the necessary dependencies to build the docs for 4.2.2.

@capac
Copy link
Author

capac commented Apr 23, 2023

Ok, so I've been able to build the Altair 4.2.2 docs for Dash. The error I was receiving previously,

Extension error (sphinxext.altairgallery):
Handler <function main at 0x154494160> for event 'builder-inited' threw an exception (exception: Command '['/usr/local/Caskroom/miniconda/base/envs/docs/bin/npm', 'bin', '--global']' returned non-zero exit status 1.)
make: *** [html] Error 2

went away when I installed chromedriver with Homebrew, instead of using the version that comes with Anaconda. I've also encountered another issue with Selenuim ( Selenium 4.3.0 has deprecated find_element_by*() methods #104) which can be easily solved by downgrading Selenuim to version 4.2.0.

As for the thumbnail errors, the fix I did was to correct the link to the thumbnail paths directly in the doc2dash Altair 4.2 docset at Altair 4.2.docset/Contents/Resources/Documents/index.html and Altair 4.2.docset/Contents/Resources/Documents/gallery/index.html, which is at best a hack but it does make the thumbnails reappear in the docs.

This issue with the thumbnails is the same I had when creating the Dash docs for Altair 4.1.0 (see Error compiling docs for v4.1.0 tag #2092 ). I'm not sure why the links to the thumbnails aren't correctly made. As it was mentioned that the thumbnails are generated in the previous versions of Altair with the altair_saver package, I hope someone with more expertise in the package can see through this issue.

I haven't had issues creating the Altair 5.0 RC1 docs for Dash using hatch. I'm just waiting for the official release of version 5 to create the Dash docs.

@binste
Copy link
Contributor

binste commented Apr 23, 2023

Glad to hear that you were able to at least resolve some of the issues you're facing with the 4.2.2 docs! I unfortunately don't have any experience with dash so I don't think I can help you with the thumbnails issue but good to know that this works for Altair 5.

@binste
Copy link
Contributor

binste commented Aug 25, 2023

Closing this as we are not working on old docs anymore but feel free to reopen if you think we can help with something!

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