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

seeking a simple way to update an environment or create it if it's missing #3726

Open
3 tasks done
atom-andrew opened this issue Jan 3, 2025 · 0 comments
Open
3 tasks done
Labels
type::question Further information is requested

Comments

@atom-andrew
Copy link

atom-andrew commented Jan 3, 2025

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Mambaforge or latest Miniforge

Search tried in issue tracker

yes

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I have this problem with Conda as well, without using Mamba

Describe your issue

We have been using the simple command:

mamba env create || mamba env update

to ensure that an environment (a) exist and (b) is up-to-date. This no longer appears to work with mamba 2.0, and I can't find a simple substitute for it. If I use mamba create -n <env name>, I'll get an interactive prompt if the environment already exists. If I add -y, then it will empty out the environment. Also, mamba env update now seems to require explicitly passing an -f environment.yml file argument.

The best I could come up with is:

yes "n" | mamba -n myenv || mamba update -y -f environment.yml

This is definitely more complicated and it requires another non-mamba command. I'd welcome a better suggestion on how to write this, but I also suspect that adding a -n option to mamba (or some way to fail quickly) would be a good thing. Also of note is that mamba env create also now requires a -f environment.yml and will again clobber the entire environment if we pass it the -y argument (whereas I'd like this command to just update missing dependencies). Thanks for your help.

mamba info / micromamba info

No response

Logs

No response

environment.yml

No response

~/.condarc

No response

@Hind-M Hind-M added the type::question Further information is requested label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants