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

micromamba shell broken since 1.4.5 #2712

Closed
jonashaag opened this issue Jul 26, 2023 · 15 comments · Fixed by #2722
Closed

micromamba shell broken since 1.4.5 #2712

jonashaag opened this issue Jul 26, 2023 · 15 comments · Fixed by #2722
Labels
type::bug Something isn't working

Comments

@jonashaag
Copy link
Contributor

I think this change #2527 broke micromamba shell

With 1.4.4, if I do

micromamba shell -n ...
which python

I get the environment's Python.

With 1.4.5, I get the system wide Python. Probably something off with PATH.

cc @AntoinePrv

fyi @0xbe7a

@jonashaag jonashaag added the type::bug Something isn't working label Jul 26, 2023
@jonashaag
Copy link
Contributor Author

On Cygwin I get

The following argument was not expected: --shell
Run with --help for more information.

@zN3utr4l
Copy link

This error is related to this issue?

micromamba --version ->1.4.9

Installing pip packages: django==3.2.20, djongo, pymongo==3.12.3, sqlparse==0.2.4, djoser, django-celery-beat, django-celery-results, django-pgviews-redux, djangorestframework, django-etc, django-filter, de
The following argument was not expected: --shell
Run with --help for more information.
critical libmamba pip failed to install packages
name: base
channels:
  - conda-forge
dependencies:
  - pip
  - python=3.9
  - pip:
    - django==3.2.20
    - --extra-index-url https://Feed:PSW@pkgs.dev.azure.com/Company/_packaging/Feed/pypi/simple/ 
    - my-pkg

@AntoinePrv
Copy link
Member

AntoinePrv commented Aug 1, 2023

@zN3utr4l No I don't think so perhaps.

@jonashaag I indeed see the environment bin dir not being the first entry present in PATH. Investigating a fix.

@AntoinePrv
Copy link
Member

@jonashaag is it micromamba shell -n giving you The following argument was not expected: --shell on Cygwin?

@jonashaag
Copy link
Contributor Author

micromamba shell -n
--name: 1 required TEXT missing
Run with --help for more information.

@jonashaag
Copy link
Contributor Author

And now I'm getting

micromamba shell -n base
warning  libmamba 'root_prefix' set with default value: C:\Users\USER\micromamba
The system cannot find the path specified.

But

micromamba run -n base which python
warning  libmamba 'root_prefix' set with default value: C:\Users\USER\micromamba
/cygdrive/c/Users/USER/micromamba/python

@AntoinePrv
Copy link
Member

So we cannot reproduce The following argument was not expected: --shell ?

For the PATH #2722 should do it

@jonashaag
Copy link
Contributor Author

Looks like it; I deleted my entire ~/micromamba a few days ago, maybe that fixed it. Although now I get another problem during self-update:

micromamba self-update


  Installing micromamba version: 1.4.9 (currently installed 1.4.5)

Transaction starting
micromamba                                           3.8MB @   3.7MB/s  1.0s
Download only - packages are downloaded and extracted. Skipping the linking phase.
The following arguments were not expected: C:\Users\USER\micromamba -p
Run with --help for more information.

@zN3utr4l
Copy link

zN3utr4l commented Aug 1, 2023

I upgraded my micromamba windows version from 1.4.1 to 1.4.9 and the error came out

@AntoinePrv AntoinePrv linked a pull request Aug 1, 2023 that will close this issue
@AntoinePrv
Copy link
Member

Let's track the self-update bug in another issue.

@RoyiAvital
Copy link

I am on 1.5.0 and I still have this issue:

image

So the error I get is:

The following argument was not expected: --shell
Run with --help for more information.

I could trace it back to _mamba_activate:

@"%MAMBA_EXE%" shell --shell cmd.exe %* 1>%UNIQUE%

After the first time I create the environment (See #1907) I always just update the binary of micromamba.exe in the root folder.

Could it be that the scripts are not updated?

@AntoinePrv
Copy link
Member

@RoyiAvital in main we have (since a couple months)

@"%MAMBA_EXE%" shell %* --shell cmd.exe 1>%UNIQUE%

Can you try mircomamba shell reinit?

@RoyiAvital
Copy link

@AntoinePrv , I got this:

Setting cmd.exe AUTORUN to: "D:\Applications\Programming\MambaPython\condabin\mamba_hook.bat"
Windows long-path support already enabled.

What does it mean setting Setting cmd.exe AUTORUN?
I had my MicroMamba environment defined with micromamba.exe shell hook -s cmd.exe -p <MAMBA_ROOT_PREFIX> -v.
Does this keep the same -p folder path or created something global?

@RoyiAvital
Copy link

RoyiAvital commented Jan 27, 2024

What's the mechanism the shell hook register system variables?
In my cmd shell I can always see a variables named MAMBA_BAT and MAMBA_EXE and D:\Applications\Programming\MambaPython\condabin; is added to the PATH variable.

Yet I don't see those in the Environment Variables in Windows:

image

I wonder, what does micromamba do to register those?
I don't find them on registry as well.

@RoyiAvital
Copy link

RoyiAvital commented Jan 27, 2024

Ok I have found, it seems it will register AutoRun in Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor:

AutoRun = "<MAMBA_ROOT_PREFIX>\condabin\mamba_hook.bat"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants