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

After updating to conda 24.9.1, mamba doesn't work with ImportError #3520

Open
3 tasks done
yangr9 opened this issue Oct 10, 2024 · 7 comments
Open
3 tasks done

After updating to conda 24.9.1, mamba doesn't work with ImportError #3520

yangr9 opened this issue Oct 10, 2024 · 7 comments

Comments

@yangr9
Copy link

yangr9 commented Oct 10, 2024

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

No relevant issues

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

After updating to conda 24.9.1, mamba doesn't work with ImportError. The specific errors are as follows:

~ mamba update --all
Traceback (most recent call last):
File "/Users/.../miniforge3/bin/mamba", line 7, in
from mamba.mamba import main
File "/Users/.../miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 18, in
from conda.cli.main import generate_parser, init_loggers
ImportError: cannot import name 'generate_parser' from 'conda.cli.main' (/Users/.../miniforge3/lib/python3.10/site-packages/conda/cli/main.py)

I tried to check Conda Release notes, it seems there are deprecations that may cause the above errors:
Remove conda.cli.main.generate_parser. Use conda.cli.conda_argparse.generate_parser instead. (#14077)
Remove conda.cli.main.init_loggers(context) (#14077)

So how to fix this? Thx

mamba info / micromamba info

~ mamba info
Traceback (most recent call last):
  File "/Users/.../miniforge3/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/Users/.../miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 18, in <module>
    from conda.cli.main import generate_parser, init_loggers
ImportError: cannot import name 'generate_parser' from 'conda.cli.main' (/Users/.../miniforge3/lib/python3.10/site-packages/conda/cli/main.py)

Logs

No response

environment.yml

No response

~/.condarc

No response

@Hind-M
Copy link
Member

Hind-M commented Oct 10, 2024

Which version of mamba are you using? If it's <= 1.5.8, it needs to be updated to >= 1.5.9 in order to work with this version of conda.

@yangr9
Copy link
Author

yangr9 commented Oct 10, 2024

My latest mamba version is 2.0.1

@yangr9 yangr9 changed the title After update to conda 24.9.1, mamba doesn't work with ImportError After updating to conda 24.9.1, mamba doesn't work with ImportError Oct 10, 2024
@Hind-M
Copy link
Member

Hind-M commented Oct 10, 2024

mamba 2.x does not rely on conda anymore. So I think that the problem is that it's mixing some older 1.x mamba version and the new one 2.0.1.
I suggest to completely remove all existing versions of mamba/conda and install a fresh mamba 2.0.1.

@Hind-M
Copy link
Member

Hind-M commented Oct 11, 2024

@yangr9 Did you manage to make it work?

@swierh
Copy link

swierh commented Oct 11, 2024

mamba 2.x does not rely on conda anymore. So I think that the problem is that it's mixing some older 1.x mamba version and the new one 2.0.1. I suggest to completely remove all existing versions of mamba/conda and install a fresh mamba 2.0.1.

For me this fixes the problem.

But note that the miniforge distribution (as recommended in the docs) is still on mamba version 1.5.9 (which is compatible with conda 24.9.1). So if you want the shiny new mamba 2.0.1, you'll have to wait for miniforge to update or get it elsewhere.

@yangr9
Copy link
Author

yangr9 commented Oct 13, 2024

Thanks for your suggestions.

I used "~ conda search mamba" to check the version of mamba, which shows the latest version of my mamba is 2.0.1. I hope this is a correct way to check the mamba version...

@jjerphan
Copy link
Member

To complete Hind's comment (i.e. #3520 (comment)), the update is blocked by #3503. See #3503 (comment) for a temporary solution to update to mamba 2.0.

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

No branches or pull requests

4 participants