-
Notifications
You must be signed in to change notification settings - Fork 376
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
Portable Windows Version #1907
Comments
I’m not sure where your start menu entry is coming from but it’s not from Micromamba. You can use Micromamba without shell integration which should make it “portable”. For your last issue, if you reproduce this can you please give instructions how to reproduce? |
Could you elaborate on:
What's the minimum things needed to be defined as variable for Regarding the issue, I don't do anything special, just switch between environments. |
Can you send a video/screenshots/text output or what you do to reproduce the problem and what’s the error message? Re: micromamaba without integration, you can just always use |
Hi, I will try to replicate and send something. But I want to focus on the portable mode. What does What does exactly the |
@jonashaag, Any chance to have the information? |
This is my initialize block for fish:
Have a look what |
|
Only for macOS/LinuxFor me, root@7085ba60af4b:/# ~/.local/bin/micromamba create -n testenv
__
__ ______ ___ ____ _____ ___ / /_ ____ _
/ / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
/ /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
/ .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
/_/
warning libmamba 'root_prefix' set with default value: /root/micromamba
Empty environment created at prefix: /root/micromamba/envs/testenv
root@7085ba60af4b:/# ~/.local/bin/micromamba activate testenv
'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 bash shell, run:
$ eval "$(micromamba shell hook --shell=bash)"
and then activate or deactivate with:
$ micromamba activate
To automatically initialize all future (bash) shells, run:
$ micromamba shell init --shell=bash --prefix=~/micromamba
Supported shells are {bash, zsh, xonsh, cmd.exe, powershell, fish}.
critical libmamba Shell not initialized Like Jonas said, executing |
Btw if you want to revert the changes by |
OK, Is there a way to skip step (2)? |
@pavelzw , In the process you described, what's the difference between |
You can think of |
The problem is that now I created a set MAMBA_ROOT_PREFIX=%~dp0
set PATH=MAMBA_ROOT_PREFIX;%PATH%
cd /d %~dp0
micromamba.exe shell hook -s cmd.exe -p %MAMBA_ROOT_PREFIX% -v I thought this will give a portable environment.
The idea is I don't want to do |
Not sure about cmd.exe but for other shells this message appears when |
OK, I think I found how to create a portable launcher: :: Mamba Settings
set MAMBA_ROOT_PREFIX=%~dp0
cd /d %~dp0
if exist "%MAMBA_ROOT_PREFIX%\Scripts\" (
:: The initialization has happened once -> Go to activation
goto start
)
micromamba.exe shell hook -s cmd.exe -p %MAMBA_ROOT_PREFIX% -v
:start
:: Shell hook was created, just activate the environment
cd /d %~dp0Scripts
activate
cd /d %~dp0 What's needed in order to make it work is using the I'm happy as now I have a completely portable Python based on Conda (MicroMamba) on Windows. @stonebig, This might be the basis for MicroMamba based |
@RoyiAvital how is this different to the "normal" cmd.exe activation? I have never used cmd.exe activation so I really don't know. I'm just wondering if we could modify the normal activation to be more portable. |
@jonashaag , I might be missing something, but what do you mean by the "normal" activation? If you mean that |
I see, then how do you use your launcher? |
OK, My launcher looks like that: :: Mamba Settings
set MAMBA_ROOT_PREFIX=%~dp0
:: Go to the `%MAMBA_ROOT_PREFIX%` folder
cd /d %~dp0
:: Assuming `micromamba.exe` is in `%MAMBA_ROOT_PREFIX%`
if not exist "micromamba.exe" goto :FAIL
:: TODO: Check this!
if exist "%MAMBA_ROOT_PREFIX%\Scripts\" (
:: The initialization has happened once -> Go to activation
goto :ACTIVATE
)
micromamba.exe shell hook -s cmd.exe -p %MAMBA_ROOT_PREFIX% -v
:ACTIVATE
:: Shell hook was created, just activate the environment
:: call Scripts\activate.bat
:: The `activate.bat` script from the folder where `micromamba.exe` resides.
:: It will generate the error: 'micromamba' is running as a sub process and can't modify the parent shell`.
:: Thus one must initialize the shell before using `activate` and `deactivate`.
cd /d %~dp0Scripts
call activate.bat
:: Go back to the root folder
cd /d %~dp0
goto :DONE
:DONE
ECHO Finished setting Conda (MicroMamba) environment!
goto :eof
:FAIL
ECHO Could not find micromamba.exe, failed setting the environment!
goto :eof Basically you can just double click it. "commandline": "%SystemRoot%\\System32\\cmd.exe /k <PathToLauncher>MambaPython.cmd", So I have an environment ready in my Windows Terminal. I have issue with |
This is what I did on my Windows terminal avoiding creating a batch file {
"commandline": "%windir%\\System32\\cmd.exe \"/K\"set MAMBA_ROOT_PREFIX=.\\root & root\\condabin\\micromamba.bat activate myenv",
"guid": "{123e4567-e89b-12d3-a456-426655440023}",
"icon": "%USERPROFILE%\\miniconda3\\Menu\\Iconleak-Atrous-Console.ico",
"name": "Micromamba"
} |
@jonashaag, Anyway to make |
The command line interfaces are incompatible so I don't recommend that |
OK, so at least |
Those are incompatible as well. |
When I run
How does it set |
According to what I found at #2712 (comment):
|
This has been refactored in mamba 2. Also notice that mamba 2 has no python code anymore, it is a dynamically linked version of micromamba, meaning it has exactly the same commands and options. You can therefore alias micromamba to mamba. Can you check that mamba 2 works as expected for you? |
I am using |
Though documentation says that the deployment model of
micromamba
is based on prefix and everything contained within it some things doesn't work like that.For instance:
micromamba
creates a start menu shortcut calledJupyter Notebook (Anaconda)
.shell init
) changed thePATH
variable of the computer globally and not only for the specific session.It would be great to have a portable mode which means everything is located in the same folder and there is a script (PS / CMD) to configure the session for work.
There is also an issue that when switching between environments repeatedly suddenly cause
micromamba
to say the shell isn't initialized andactivate
can not be used. It requires opening a new CMD window to continue to work.The text was updated successfully, but these errors were encountered: