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

mamba init fails during compass conda environment setup #544

Closed
trhille opened this issue Feb 27, 2023 · 3 comments · Fixed by #545
Closed

mamba init fails during compass conda environment setup #544

trhille opened this issue Feb 27, 2023 · 3 comments · Fixed by #545

Comments

@trhille
Copy link
Collaborator

trhille commented Feb 27, 2023

On Perlmutter, I get the following error when I execute ./conda/configure_compass_env.py --conda ~/miniconda3 -m pm-cpu --with_albany :

Traceback (most recent call last):
  File "/global/cfs/cdirs/piscees/trhille/compass/./conda/configure_compass_env.py", line 120, in <module>
    main()
  File "/global/cfs/cdirs/piscees/trhille/compass/./conda/configure_compass_env.py", line 102, in main
    install_miniconda(conda_base, activate_base, logger)
  File "/global/cfs/cdirs/piscees/trhille/compass/conda/shared.py", line 181, in install_miniconda
    check_call(commands, logger=logger)
  File "/global/cfs/cdirs/piscees/trhille/compass/conda/shared.py", line 145, in check_call
    raise subprocess.CalledProcessError(process.returncode, commands)
subprocess.CalledProcessError: Command 'source /global/homes/t/trhille/miniconda3/etc/profile.d/conda.sh; source /global/homes/t/trhille/miniconda3/etc/profile.d/mamba.sh; conda activate; conda config --add channels conda-forge; conda config --set channel_priority strict; conda install -y boa; conda update -y --all; mamba init' returned non-zero exit status 1.

I tried executing each of the commands in the error, and the issue appears to be the mamba init command:

'Namespace' object has no attribute 'no_user'

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/global/u1/t/<TOKEN>/mambaforge/lib/python3.10/site-packages/conda/exceptions.py", line 1124, in __call__
        return func(*args, **kwargs)
      File "/global/u1/t/<TOKEN>/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 936, in exception_converter
        raise e
      File "/global/u1/t/<TOKEN>/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 929, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
      File "/global/u1/t/<TOKEN>/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 887, in _wrapped_main
        result = do_call(parsed_args, p)
      File "/global/u1/t/<TOKEN>/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 758, in do_call
        exit_code = shell_init(args)
      File "/global/u1/t/<TOKEN>/mambaforge/lib/python3.10/site-packages/mamba/mamba_shell_init.py", line 87, in shell_init
        if args.no_user:
    AttributeError: 'Namespace' object has no attribute 'no_user'

I changed https://github.com/MPAS-Dev/compass/blob/main/conda/shared.py#L179 from mamba init to conda init and was able to successfully create dev_compass_1.2.0-alpha.4

@trhille
Copy link
Collaborator Author

trhille commented Feb 27, 2023

I should note that I got the same error when I pointed the --conda flag at my mambaforge install.

@xylar
Copy link
Collaborator

xylar commented Feb 28, 2023

This appears to be an incompatibility between the latest conda and anything but the latest mamba. Something like:

source ~/mambaforge/etc/profile.d/conda.sh
source ~/mambaforge/etc/profile.d/mamba.sh
mamba activate
mamba remove -y boa
mamba update mamba

should fix it. Then, rerun ./conda/configure...

@xylar
Copy link
Collaborator

xylar commented Feb 28, 2023

I can try to add this to compass itself later today.

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 a pull request may close this issue.

2 participants