Skip to content

Upstream changes in Powershell 7.5.0 break conda command script #760

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

Open
1 task done
kalingibbons opened this issue Mar 30, 2025 · 3 comments
Open
1 task done
Labels
bug Something isn't working windows

Comments

@kalingibbons
Copy link

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

I spent Friday repeatedly rolling back my workstation miniforge installation because I could no longer use conda in powershell. Eventually I noticed that Powershell 5.1 shipped with Windows was working normally. I ended up with two command prompts side-by-side, entering powershell -noprofile and pwsh -noprofile, then loading each of the files specific to the PS5.1 $PROFILE variable into both terminals, one-by-one. This resulted in a working PS5.1 prompt and a broken PS7.5 prompt.

Looks like they bumped a version on the .NET SDK. Here's two relevant links:

https://github.com/PowerShell/PowerShell/releases/tag/v7.5.0

https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-75?view=powershell-7.5#breaking-changes

Confirmed behavior using my home computer now and a workstation on Friday.

PowerShell 7.5.0
Loading personal and system profiles took 986ms.
PS C:\Users\x> conda activate base
(base) PS C:\Users\x> conda deactivate
usage: conda-script.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
conda-script.py: error: argument COMMAND: invalid choice: '' (choose from 'activate', 'clean', 'commands', 'compare', 'config', 'create', 'deactivate', 'doctor', 'env', 'export', 'info', 'init', 'install', 'list', 'notices', 'package', 'remove', 'rename', 'repoquery', 'run', 'search', 'uninstall', 'update', 'upgrade')
(base) PS C:\Users\x> conda
usage: conda-script.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
conda-script.py: error: argument COMMAND: invalid choice: '' (choose from 'activate', 'clean', 'commands', 'compare', 'config', 'create', 'deactivate', 'doctor', 'env', 'export', 'info', 'init', 'install', 'list', 'notices', 'package', 'remove', 'rename', 'repoquery', 'run', 'search', 'uninstall', 'update', 'upgrade')
(base) PS C:\Users\x>

Rolling back to previous version of powershell on my home computer:

PowerShell 7.4.7

   A new PowerShell stable release is available: v7.5.0
   Upgrade now, or check out the release page at:
     https://aka.ms/PowerShell-Release?tag=v7.5.0

Loading personal and system profiles took 712ms.
PS C:\Users\x> conda activate base
(base) PS C:\Users\x> conda deactivate
PS C:\Users\x> conda
usage: conda-script.py [-h] [-v] [--no-plugins] [-V] COMMAND ...

conda is a tool for managing and deploying applications, environments and packages.

options:
  -h, --help          Show this help message and exit.
  -v, --verbose       Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG
                      logging, four times for TRACE logging.
  --no-plugins        Disable all plugins that are not built into conda.
  -V, --version       Show the conda version number and exit.

commands:
  The following built-in and plugins subcommands are available.

  COMMAND
    activate          Activate a conda environment.
    clean             Remove unused packages and caches.
    commands          List all available conda subcommands (including those from plugins). Generally only used by tab-
                      completion.
    compare           Compare packages between conda environments.
    config            Modify configuration values in .condarc.
    create            Create a new conda environment from a list of specified packages.
    deactivate        Deactivate the current active conda environment.
    doctor            Display a health report for your environment.
    export            Export a given environment
    info              Display information about current conda install.
    init              Initialize conda for shell interaction.
    install           Install a list of packages into a specified conda environment.
    list              List installed packages in a conda environment.
    notices           Retrieve latest channel notifications.
    package           Create low-level conda packages. (EXPERIMENTAL)
    remove (uninstall)
                      Remove a list of packages from a specified conda environment.
    rename            Rename an existing environment.
    repoquery         Advanced search for repodata.
    run               Run an executable in a conda environment.
    search            Search for packages and display associated information using the MatchSpec format.
    update (upgrade)  Update conda packages to the latest compatible version.
PS C:\Users\x>

Installed packages

winget install --id CondaForge.Miniforge3 --version 24.11.3-2
# Repeat with all previous winget releases to 24.7.1-0

Environment info

# I'm not at my work computer on the weekends
@yyhran
Copy link

yyhran commented Apr 11, 2025

This is a bug in conda, and it was fixed in version 25.1.1 (conda/conda#14292). Unfortunately, the conda version included with the current miniforge does not have this fix. We can manually update the conda version built into miniforge by using the following commands in the Miniforge Prompt, and then rerun conda init.

conda install -n base conda=25.1.1 -c conda-forge --override-channels --yes
conda init --reverse
conda init

@hmaarrfk
Copy link
Contributor

25.1.1 (conda/conda#14292). Unfortunately, the conda version included with the current miniforge does not have this fix.

You can try https://github.com/conda-forge/miniforge/releases/tag/25.3.0-1

(sorry i can't help troubleshoot, i don't know how to use windows tools)

@yyhran
Copy link

yyhran commented Apr 11, 2025

25.1.1 (conda/conda#14292). Unfortunately, the conda version included with the current miniforge does not have this fix.

You can try https://github.com/conda-forge/miniforge/releases/tag/25.3.0-1

(sorry i can't help troubleshoot, i don't know how to use windows tools)

Thanks, 25.3.0-1 works on my windows.

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

No branches or pull requests

3 participants