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

Replaces anaconda python installation with miniforge #839

Merged
merged 3 commits into from
Mar 14, 2025

Conversation

dpshelio
Copy link
Contributor

@dpshelio dpshelio commented Sep 6, 2024

Due to the anaconda ToS changes, using conda-forge avoids that learners may be in breach of the ToS after they leave the workshop. This has been discussed in Carpentries #genral Slack and a pip alternative is provided at #837.

It provides instructions to create a swc environment is created with the basic needs for the workshops (includes explicitly both numpy for the inflammation lesson and pandas for the gapminder).

This, however, has the added difficulty to require that learners change environment (conda activate swc) and start jupyter from the terminal and not from a launcher (as anaconda provides for Windows and macOS).

I've tried to find up a way to get jupyter installed in the base env, and provide instructions to create a shortcut, but it becomes too cumbersome, plus it would only benefit Windows users. A comment has been left there to inform future attempts.

Copy link

netlify bot commented Sep 6, 2024

Deploy Preview for workshop-template-previews ready!

Name Link
🔨 Latest commit b431eaf
🔍 Latest deploy log https://app.netlify.com/sites/workshop-template-previews/deploys/67225d43e050d10008e6a953
😎 Deploy Preview https://deploy-preview-839--workshop-template-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@n2ygk
Copy link

n2ygk commented Sep 6, 2024

@dpshelio Given our workshops generally teach basic shell CLI (using git-bash on Windows, Terminal on MacOS, bash on Linux), I think it's OK to ask people to launch jupyter lab from the CLI. That also makes sure their CWD is in the "right" place vs. having to show them how to navigate back to their Desktop in Windows when using the launcher.

@dpshelio
Copy link
Contributor Author

dpshelio commented Sep 6, 2024

@n2ygk I also think it's not too much of a cognitive load to launch from the terminal, and it also avoids the problem we've encountered a few times with Windows where learners don't recognise the directories Jupyter is showing (normally on computers that got two user directory structure due to onedrive, and Jupyter opening the "standard" user profile and not the one the user is familiar with which normally is onedrive's).

@tobyhodges
Copy link
Member

Thank you for submitting this @dpshelio. We established a task force to update the lesson setup instructions, and I would like to wait until that group has had time to consider the various different options, before implementing any change. The task force's decision will be made in the next month or so.

@tobyhodges tobyhodges added the status:wait Progress dependent on another issue or conversation label Sep 23, 2024
Copy link
Member

@tobyhodges tobyhodges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for opening this PR @dpshelio and for your patience while the Lesson Setup Instructions task force did its work. (Recommendations to be published next week.)

I request a few changes before this could be merged. The major one is to adjust the environment YAML file to include all the dependencies for Python lessons aimed at novices across Data Carpentry, Library Carpentry, and Software Carpentry lessons (and adjusting the name of the file+environment to reflect this). I also think we need to be extra careful to ensure that learners download the file to their Downloads folder, so that the subsequent step they run on the command line will be more likely to work.

Comment on lines +1 to +9
name: swc
channels:
- conda-forge
dependencies:
- ipykernel
- jupyter
- matplotlib
- numpy
- pandas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: swc
channels:
- conda-forge
dependencies:
- ipykernel
- jupyter
- matplotlib
- numpy
- pandas
name: carpentries
channels:
- conda-forge
dependencies:
- ipykernel
- jupyter
- matplotlib
- numpy
- pandas
- plotnine
- plotly
- seaborn

Add a few more libraries to support the DC and LC (novice) Python lessons as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also require the filename to change (e.g. cp_environment.yml)

Comment on lines +141 to +142
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>.</li>
<li>Search for the application "Miniforge Prompt", open it and run: <code>conda env create -f ~/Downloads/swc_environment.yml</code></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How confident can we be that ~/Downloads/ is the location where everyone will find the environment file after downloading it? I feel that we need to provide additional details here to ensure that learners save it to the right place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>.</li>
<li>Search for the application "Miniforge Prompt", open it and run: <code>conda env create -f ~/Downloads/swc_environment.yml</code></li>
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>. Save the file to your Downloads folder.</li>
<li>Search for the application "Miniforge Prompt", open it and run: <code>conda env create -f ~/Downloads/swc_environment.yml</code></li>

to prepend Miniforge to your <code>PATH</code>
(this makes the Miniforge distribution the default Python).
</li>
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>.</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>.</li>
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>. Save the file to your Downloads folder.</li>

and need to update miniconda for miniforge
Also, the https://pypi.org/project/start-jupyter-cm/ could be helpful.
{% endcomment %}
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>.<br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>.<br>
<li>Download the <a href="./data/swc_environment.yml" download>environment file</a>. Save the file to your Downloads folder.<br>

@tobyhodges tobyhodges removed the status:wait Progress dependent on another issue or conversation label Mar 7, 2025
@tobyhodges
Copy link
Member

I would like to make these updates ASAP so I will merge this now and apply my changes afterwards. Thanks again for contributing this @dpshelio ❤️

@tobyhodges tobyhodges merged commit 6f61128 into carpentries:gh-pages Mar 14, 2025
6 checks passed
@dpshelio dpshelio deleted the miniforge branch March 14, 2025 19:57
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

Successfully merging this pull request may close these issues.

3 participants