setup-micromamba icon indicating copy to clipboard operation
setup-micromamba copied to clipboard

micromamba is not recognized as an internal or external command 2.0.0

Open ktsitsi opened this issue 1 year ago • 6 comments

Yesterday we noticed a failure in our CI only on the windows-latest runner where we were getting the following error:

'"C:\Users\runneradmin\micromamba\condabin\micromamba"' is not recognized as an internal or external command,
operable program or batch file.

using the mamba-org/setup-micromamba@v1. while running a simple pre-commit check using the env.

Run micromamba run -n test pre-commit run -a

Taking a look at the logs the only difference we notice is that micromamba info was now fetching

libmamba version : 2.0.0
micromamba version : 2.0.0

We were able to resolve by pinning to mamba-org/[email protected] with the micromamba-version: 1.5.10-0 following similar approach as commented in https://github.com/mamba-org/setup-micromamba/issues/225

Runner Logs here

ktsitsi avatar Sep 27 '24 07:09 ktsitsi

Was hoping mamba=2.0.1 would fix this (there was a fix for a windows bug on mamba activate), but that doesn't seem to be case. Not sure if this is a problem on setup-micromamba's end or regular mamba's end?

Runner Logs: https://github.com/jeremyleung521/LPATH/actions/runs/11088430490/job/30931937962#step:4:362 Note: Can't see that it's running 2.0.1 in the windows jobs due to the order things are printed, but the other tests (macos, ubuntu) do say that 2.0.1 is pulled.

EDIT: It's being tracked here: https://github.com/mamba-org/mamba/issues/3478

jeremyleung521 avatar Oct 01 '24 18:10 jeremyleung521

i would expect that this is a micromamba issue. wdyt @jjerphan?

pavelzw avatar Oct 02 '24 09:10 pavelzw

It is. There's a problem with the activation script on Windows as of micromamba 2.0. We are currently addressing the problem.

jjerphan avatar Oct 02 '24 09:10 jjerphan

2.0.2 is being released and should fix this issue.

jjerphan avatar Oct 02 '24 18:10 jjerphan

2.0.2 is being released and should fix this issue.

Thank you! Just have to wait for micromamba-releases to update, then should be able to test!

jeremyleung521 avatar Oct 02 '24 20:10 jeremyleung521

I just updated to v2 (2.0.2) and still having the same problem... :/ Though this time, it's failing in the 'pip' section of the environment file.

 Or to execute a single command in this environment, use:
  
      micromamba run -n test mycommand
  
  warning  libmamba You are using 'pip' as an additional package manager.
      Be aware that packages installed with 'pip' are managed independently from 'conda-forge' channel.
  
  Installing pip packages: pylcs, ray, timedinput, argparse-tui
  '"C:\Users\runneradmin\micromamba\condabin\micromamba"' is not recognized as an internal or external command,
  operable program or batch file.
  critical libmamba pip failed to install packages

Log file: https://github.com/jeremyleung521/LPATH/actions/runs/11182636779/job/31089361519#step:4:370

EDIT: It's this bug: https://github.com/mamba-org/mamba/issues/3467.

jeremyleung521 avatar Oct 04 '24 15:10 jeremyleung521

#234 resolved the cause of the problem.

Updating setup-micromamba to 2.0.0 should resolve the issue.

jjerphan avatar Oct 07 '24 07:10 jjerphan

#234 resolved the cause of the problem.

Updating setup-micromamba to 2.0.0 should resolve the issue.

Unfortunately it doesn't :( It works fine installing the conda packages, but I eventually get to the same error while trying to install the pip packages from the environment file. It's this error: https://github.com/mamba-org/mamba/issues/3467.

Logs: https://github.com/jeremyleung521/LPATH/actions/runs/11218580614/job/31182684438?pr=10#step:4:348

jeremyleung521 avatar Oct 07 '24 15:10 jeremyleung521

I don't really know if this is good or not, but as a temporary fix, I copied the already existing mamba.bat to micromamba.bat inside the directory provided in the error, and was able to install packages from pip.

e.g. in my case I got this error:

'"C:\Users\ika\AppData\Roaming\mamba\condabin\micromamba"' is not recognized as an internal or external command,
operable program or batch file.
critical libmamba pip failed to install packages

In PowerShell, I did the following

PS C:\> cd C:\Users\ika\AppData\Roaming\mamba\condabin
PS C:\Users\ika\AppData\Roaming\mamba\condabin> ls

    Directory: C:\Users\ika\AppData\Roaming\mamba\condabin

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2024/10/29    18:02           1911 _mamba_activate.bat
-a---          2024/10/29    18:02            142 activate.bat
-a---          2024/10/29    18:02            778 mamba_hook.bat
-a---          2024/10/29    18:02            851 mamba.bat
PS C:\Users\ika\AppData\Roaming\mamba\condabin> cp mamba.bat micromamba.bat

Then I went back to the original directory, reran the micromamba create env command and everything worked fine.

This is a little perplexing though because on the surface it looks like the installer script copies a micromamba.bat file into the install location though... https://github.com/mamba-org/setup-micromamba/blob/617811f69075e3fd3ae68ca64220ad065877f246/src/shell-init.ts#L40

But this copyMambaBatToMicromambaBat function does not seem to be getting called anywhere in the codebase...so not sure what's going on

ika-musuko avatar Oct 29 '24 09:10 ika-musuko

This still happens in our CI: https://github.com/pydata/sparse/actions/runs/11721178880/job/33114861510?pr=805

hameerabbasi avatar Nov 18 '24 03:11 hameerabbasi

Can you let us know if using micromamba 2.0.4 and setup-micromamba 2.0.2 fixed this problem?

jjerphan avatar Nov 25 '24 18:11 jjerphan

I confirm that this has been resolved by micromamba 2.0.4 and setup-micromamba 2.0.2.

See the logs on my fork of https://github.com/pydata/sparse/pull/816.

jjerphan avatar Nov 26 '24 15:11 jjerphan

@jjerphan The issue on our end is fixed now.

ktsitsi avatar Nov 26 '24 16:11 ktsitsi

Can you let us know if using micromamba 2.0.4 and setup-micromamba 2.0.2 fixed this problem?

It's also fixed in pydata/sparse. Thank you!

mtsokol avatar Nov 26 '24 16:11 mtsokol