When executing jupyter book on github pages. Error: No module named numpy
My myst.yml file is as follows:
version: 1
project:
title: A title
date: 2025/01/21
jupyter: true
github: repo_link
authors:
- name: Atharva Aalok
email: [email protected]
corresponding: true
affiliations: Stanford University
twitter: atharvaaalok
github: atharvaaalok
toc:
- file: introduction.ipynb
- file: the_idea_injective_net.ipynb
- file: auxilliary_networks.ipynb
site:
template: book-theme
title: Geom
When I run the book on github pages, I get the error:
ModuleNotFoundError: No module named 'numpy'
How can I fix this? I will also eventually wish to run pytorch so it should be a solution that would work for that as well.
There are many ways to execute code for a Jupyter Book. You can run your code cells at deploy time (in CI), or when the user interacts with the page (at read-time). You're asking about read-time.
I've made a PR to the repo I think you're referring to: https://github.com/atharvaaalok/neural_injective_geometry/pull/1
This PR sets up the machinery to do both, but does not actually execute the notebooks (I've commented out that flag)
To execute your notebooks at deploy time, you'll need to update your deploy environment to include these files.