Jupyter Notebook Fails

Hello all,

I’ve configured the Jupyter Notebook interactive app previously a couple of times without issue, but it’s been a while, and I’m encountering a problem on a new cluster that I haven’t seen before. This is NOT a problem with OOD, but I’m hopeful someone can assist anyway, as Google hasn’t been particularly helpful…

I’m on Rocky 9.4 and by default the system Python installation is managed through DNF (as opposed to, e.g., pip3). I can install the core Jupyter with dnf install python3-jupyter-core and then configure the basic Jupyter interactive sandbox app according to the tutorial, but the error returned when trying to launch is:

Jupyter command 'jupyter-notebook' not found.

This is not isolated to the interactive app. From the command line, jupyter notebook produces the same error, as does python3 -m jupyter notebook.

I’m certain I can avoid all of this by using, e.g., miniconda or a virtual environment, but that doesn’t allow me to create a system-wide interactive app through OOD. All advice (rightly) encourages users to use some kind of virtual environment rather than the system version of Python, but I’d imagine others would encounter a similar issue when trying to work through the steps for the interactive app, especially if they are using dnf rather than pip.

Any guidance would be appreciated.

Warmest regards,
Jason

We generally use modules for that type of issue. That is, we have python modules for sure, but we also have jupyter modules that the users load. I believe the jupyter module is itself a miniconda environment (at least at OSC) but I’m sure you could set it up in a variety of ways.

In any case - I think a module with all these packages installed is what you’re looking for.

Hello Jeff,

I see that’s what you and some others do, it’s just I’ve not had to do that in the past. I’m happy to configure a miniconda environment, though would you be willing to share examples of how you use a module to source that environment? I’ve done some limited messing around and am not making any real progress.

Thanks,
Jason

OK - OSC does use virtual environment. We use the execute function in lmod to activate the environment when the module is loaded.

I pulled this line directly from our lua file - I only modified the path to the shell script.

execute{cmd="source /path/to/the/module/app_jupyter/3.0.17/bin/activate", modeA={"load"}}