mamba icon indicating copy to clipboard operation
mamba copied to clipboard

Windows install recommends PowerShell but bzip2 not available

Open MartinJepsen opened this issue 2 years ago • 10 comments

Troubleshooting docs

  • [X] My problem is not solved in the Troubleshooting docs

How did you install Mamba?

Other (please describe)

Search tried in issue tracker

bzip2, windows bzip2

Latest version of Mamba

  • [X] My problem is not solved with the latest version

Tried in Conda?

Not applicable

Describe your issue

The docs for Windows installation (link) recommend PowerShell for install, but Windows does not have native support for bzip2, so the command

tar xf micromamba.tar.bz2

will not work. It outputs

tar.exe: Error opening archive: Can't initialize filter; unable to run program "bzip2 -d"

mamba info / micromamba info

No response

Logs

No response

environment.yml

No response

~/.condarc

No response

MartinJepsen avatar Oct 26 '23 11:10 MartinJepsen

Is this not an option for you? https://mamba.readthedocs.io/en/latest/micromamba-installation.html#install-script

jonashaag avatar Oct 26 '23 11:10 jonashaag

I think we could change those URLs to uncompressed ones though

jonashaag avatar Oct 26 '23 11:10 jonashaag

Is this not an option for you? https://mamba.readthedocs.io/en/latest/micromamba-installation.html#install-script

Yes it is, but the issue is about the manual install documentation recommending PowerShell which won't work. For context, I'm writing a small tutorial on installing micromamba for an audience that doesn't have git bash.

MartinJepsen avatar Oct 26 '23 11:10 MartinJepsen

I think we could change those URLs to uncompressed ones though

I think that would be a good option, because then Windows users can install micromamba with PowerShell only, meaning that they won't need to install either Git Bash or something that can handle bzip2.

MartinJepsen avatar Oct 26 '23 11:10 MartinJepsen

If I'm not mistaken you can try the URLs from the install.sh script

jonashaag avatar Oct 26 '23 12:10 jonashaag

@jonashaag I would like to add the updated installation instructions for Windows PowerShell such that there is no need for Git Bash as PowerShell by default supports bzip2. The updated code installs micromamba using PowerShell. It will fix the issue raised by @MartinJepsen.

Download the binary

Invoke-Webrequest -URI https://micro.mamba.pm/api/micromamba/win-64/latest -OutFile micromamba.tar.bz2 mkdir "$HOME\micromamba" bzip2 -d micromamba.tar.bz2 tar xf micromamba.tar -C "$HOME\micromamba"

Remove the tar archive

Remove-Item micromamba.tar

Invoke the hook

& "$HOME\micromamba\Library\bin\micromamba.exe" shell hook -s powershell | Out-String | Invoke-Expression

and use micromamba directly

micromamba create -f ./test/env_win.yaml -y micromamba activate yourenv

nmishra93 avatar Dec 10 '23 06:12 nmishra93

Please send a PR, thank you

jonashaag avatar Dec 10 '23 08:12 jonashaag

But we don't need tar/bzip2 if we use the uncompressed URL (see install.sh script)

jonashaag avatar Dec 10 '23 11:12 jonashaag

I actually ended up using the instructions provided in the README for micromamba-releases: https://github.com/mamba-org/micromamba-releases

Works perfect

MartinJepsen avatar Jan 09 '24 13:01 MartinJepsen

I tried with uncompressed link, e.g. https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64, without success:

Invoke-Webrequest -URI https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64 -OutFile micromamba.exe
.\micromamba.exe shell hook -s powershell | Out-String | Invoke-Expression
# Invoke-Expression : Cannot bind argument to parameter 'Command' because it is an empty string.

floriandeboissieu avatar Feb 23 '24 10:02 floriandeboissieu