mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.79k stars 348 forks source link

Cannot use csh with micromamba #3333

Open abazabaaa opened 3 months ago

abazabaaa commented 3 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Micromamba

Search tried in issue tracker

csh or tcsh

Latest version of Mamba

Tried in Conda?

Not applicable

Describe your issue

micromamba is supposed to support csh, but when attempting to initialize the shell you get an error saying that csh is not a shell choice:

micromamba activate chemprop

'micromamba' is running as a subprocess and can't modify the parent shell. Thus you must initialize your shell before using activate and deactivate.

To initialize the current csh shell, run: $ eval "$(micromamba shell hook --shell csh)" and then activate or deactivate with: $ micromamba activate To automatically initialize all future (csh) shells, run: $ micromamba shell init --shell csh --root-prefix=~/micromamba If your shell was already initialized, reinitialize your shell with: $ micromamba shell reinit --shell csh Otherwise, this may be an issue. In the meantime you can run commands. See: $ micromamba run --help

Supported shells are {bash, zsh, csh, xonsh, cmd.exe, powershell, fish}. critical libmamba Shell not initialized

micromamba shell init --shell csh --root-prefix=~/micromamba_csh --shell: csh not in {bash,cmd.exe,dash,fish,posix,powershell,tcsh,xonsh,zsh} Run with --help for more information.

Then if trying to use tcsh instead you get another error: micromamba shell init --shell tcsh --root-prefix=~/micromamba_csh critical libmamba Support for other shells not yet implemented.

mamba info / micromamba info

libmamba version : 1.5.8
     micromamba version : 1.5.8
           curl version : libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
     libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : xxx/envs
                          xxx/envs
          package cache : xxx/conda/pkgs
            environment : None (not found)
           env location : -
      user config files : /home/xxx/.mambarc
 populated config files : /home/xxx/.condarc
       virtual packages : __unix=0=0
                          __linux=3.10.0=0
                          __glibc=2.17=0
                          __archspec=1=x86_64-v4
                          __cuda=11.4=0
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/openeye/linux-64
                          https://conda.anaconda.org/openeye/noarch
       base environment : /home/grahat12/micromamba
               platform : linux-64

Logs

No response

environment.yml

No response

~/.condarc

No response

Hind-M commented 3 months ago

This indeed looks like a bug. Thanks for reporting!

zworkinspace commented 1 month ago

The micromamba.csh script fails in csh or tcsh due to the line:

set ask_conda="\(setenv prompt "${prompt}"; __mamba_exe shell "!*" --shell csh)`"`

With error:

Unmatched '''.

Sadly, while I hate using csh or tcsh, preferring zsh or at least bash, many of my colleagues need to run in csh due to legacy tools. Not having a workable micromamba executable is annoying.

I'd suggest refactoring micromamba.csh to avoid battleship aliases with four levels of quoting, which csh handles so poorly. Apologies, I don't have the cycles right now to contribute a fix.