landlab / landlab

Landlab codebase, wiki, and tests
https://landlab.readthedocs.io/
MIT License
358 stars 335 forks source link

Tutorials user guide: requirements don't install on jupyterhub lab.openearthscape.org #1526

Open sebastien-lenard opened 1 year ago

sebastien-lenard commented 1 year ago

When I follow the Tutorials user guide [https://landlab.readthedocs.io/en/master/user_guide/tutorials.html],

(1) the command conda install --file=requirements-notebooks.txt doesn't work and should be replaced in the guide by: conda install --file=landlab-master/requirements-notebooks.txt

(2) the requirements don't install and yield the following message:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

ResolvePackageNotFound: 
  - conda==4.10.3

Related to #1519 #1520

mdpiper commented 1 year ago

I wonder if we should instruct users to install the notebook dependencies into an environment. We could replace the "Install dependencies" section with something like this:

Create an environment

Create an environment to install the dependencies needed to run the notebooks.

conda create -n landlab-notebooks --file landlab-master/requirements-notebooks.txt

Once the environment has been created, activate it.

conda activate landlab-notebooks

Note that on Linux and macOS, you may have to use the source command instead of conda in this step.

mcflugen commented 1 year ago

(1) the command conda install --file=requirements-notebooks.txt doesn't work and should be replaced in the guide by: conda install --file=landlab-master/requirements-notebooks.txt

The name of the folder that contains the notebooks will change depending on what version of the notebooks you have downloaded. The default is to download the latest version that's on the master branch but one could also download the notebooks for another version (e.g. 2.5.0). Since the name of the folder isn't always landlab-master, I didn't include the name of the folder in the docs. Note that the message printed by the notebooks.py script does give the full path to the requirements file.

(2) the requirements don't install and yield the following message:

Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

ResolvePackageNotFound:

  • conda==4.10.3

I'm not sure about this one as it works for me. Perhaps it has something to do with the conda installation on this JupyterHub?

I wonder if we should instruct users to install the notebook dependencies into an environment.

I agree. I'll add something like what you have and link to the Landlab's documentation on virtual environments.

I'll also include instructions with the option to use mamba. Because of the large number of packages needed to run all of the notebooks, using mamba would significantly reduce the installation time.

Note that on Linux and macOS, you may have to use the source command instead of conda in this step

I haven't had to do this for a long time. Unless users have version of conda that's very much out-of-date, this shouldn't be an issue.

sebastien-lenard commented 1 year ago

Hey and thank you both for your reactivity!

The command

conda create -n landlab-notebooks --file landlab-master/requirements-notebooks.txt

worked on the lab.openearthscape.org jupyterhub with this warning:

  current version: 4.12.0
  latest version: 22.11.1

And conda activate landlab-notebooks doesn't work and should be replaced by source activate [...] on this jupyterhub.

I tried a few notebooks using the CSDMS kernel and they work. The thing with creating a personal landlab-notebook environment is that we cannot access to it as a kernel in the jupyterhub, so I'm not sure if it's relevant (in the case of the lab.openearthscape.org jupyterhub )