prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.21k stars 176 forks source link

Failed to `pixi config set mirrors` in Windows Terminal #1677

Open AlphonseZetta10 opened 3 months ago

AlphonseZetta10 commented 3 months ago

Checks

Reproducible example

pixi config set --global mirrors '{"https://conda.anaconda.org/": ["https://prefix.dev/conda-forge"]}'

Just like what manual said

OS: Windows 10 19044.4651 Terminal: Windows Terminal Shell: Powershell

Issue description

PS *** > pixi config set --global mirrors '{"https://conda.anaconda.org/": ["https://prefix.dev/conda-forge"]}'
  × key must be a string at line 1 column 2

Expected behavior

write the mirror setting into global config located in %USERPROFILE%/.pixi

ruben-arts commented 3 months ago

This exact command works for my machine. Could it be that your config is not readable?

This error should improve nonetheless

AlphonseZetta10 commented 3 months ago

Could it be that your config is not readable?

I don't think so. I tried to remove --global and met the same error.

I tried in CMD too and it returned this

error: unexpected argument '[https://prefix.dev/conda-forge]}'' found

Usage: pixi config set [OPTIONS] <KEY> [VALUE]

For more information, try '--help'.
chawyehsu commented 3 months ago

it works fine image

AlphonseZetta10 commented 3 months ago

New updates: I tried in zsh in ConEmu and Windows Terminal, and it works, so maybe something wrong with the powershell and cmd. ConEmu Windows Terminal + powershell Windows Terminal + zsh

baszalmstra commented 2 months ago

I can confirm that only with "Command Prompt" I get this error:

error: unexpected argument '[https://prefix.dev/conda-forge]}' found

Usage: pixi config set [OPTIONS] <KEY> [VALUE]

For more information, try '--help'.

You can solve this by escape the quotes with quotes:

pixi config set --global mirrors "{""https://conda.anaconda.org/"": [""https://prefix.dev/conda-forge""]}"
AlphonseZetta10 commented 2 months ago

I can confirm that only with "Command Prompt" I get this error:

error: unexpected argument '[https://prefix.dev/conda-forge]}' found

Usage: pixi config set [OPTIONS] <KEY> [VALUE]

For more information, try '--help'.

You can solve this by escape the quotes with quotes:

pixi config set --global mirrors "{""https://conda.anaconda.org/"": [""https://prefix.dev/conda-forge""]}"

Thank you. I have tried it and it DO fix the problem in Command Prompt. But in Powershell it still report error. Could it be a locale-related error?