[Python] Fresh install Windows miniforge prompt does not start in base environment, throws...

Discussão em 'Python' iniciado por Stack, Maio 12, 2025.

  1. Stack

    Stack Membro Participativo

    I just installed miniforge 25.3.0-1 on my Windows 11 computer. After installing to my user account only and not adding miniforge to PATH, I opened the mininforge prompt to try and create a virtual environment to install some python packages. When I open the prompt, I notice that it does not have the (base) modifier in front of the command line that I have seen before.

    When I attempt to create a virtual environment with mamba create --name test_env, it returns: Empty environment created at prefix: C:\Users\Name\miniforge3\envs\test_env.

    If I add an installation modifier to the command like so:mamba create --name test_env python it seems to actually create an environment and install things and then it outputs the usual message saying to use mamba activate test_env to activate the environment.

    However, when I use that command it returns this error:

    critical libmamba Shell not initialized

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

    To automatically initialize all future (cmd.exe) shells, run:
    $ mamba shell init --shell cmd.exe --root-prefix=~/.local/share/mamba
    If your shell was already initialized, reinitialize your shell with:
    $ mamba shell reinit --shell cmd.exe
    Otherwise, this may be an issue. In the meantime you can run commands. See:
    $ mamba run --help

    Supported shells are {bash, zsh, csh, posix, xonsh, cmd.exe, powershell, fish, nu}.


    I read on a different forum post that you should use conda activate instead of mamba activate but that everything else should work with mamba, so I tried that. Unfortunately, nothing happens at all when I use conda activate test_env and I don't see the expected (test_env) modifier before the input line.

    The same issues occur if I use conda create --name test_env2, though it does seem to create an environment without having to add python at the end of that command. Still, it does not open the environment after I create it.

    If I run the command that it provided mamba shell init --shell cmd.exe --root-prefix=~/.local/share/mamba and then restart the prompt, it now has (C:\Users\Name\miniforge3) as a modifier before the input line. But, trying to activate the environment with mamba just returns critical libmamba Cannot activate, prefix does not exist at: 'C:\Users\Name\.local\share\mamba\envs\test_env'. Using conda to activate the environment again just does nothing at all.

    I am very new to conda/mamba/miniforge so I am not sure what I am doing wrong, but I was able to use miniforge successfully on a different computer some time ago with (as I recall) the same method, so I am stuck. The only forum posts I can find are folks with issues of their commands not working from the command prompt or powershell, but mine will not even work from the miniforge prompt and I can't seem to find anything about this elsewhere. Any help is appreciated!

    Continue reading...

Compartilhe esta Página