-
Notifications
You must be signed in to change notification settings - Fork 432
Open
Labels
type::bugSomething isn't workingSomething isn't workingwhere::windowsWindows-specific issuesWindows-specific issues
Description
Troubleshooting docs
- My problem is not solved in the Troubleshooting docs
Anaconda default channels
- I do NOT use the Anaconda default channels (pkgs/* etc.)
How did you install Mamba?
Micromamba
Search tried in issue tracker
Unexpected token 'activate' in expression or statement
Latest version of Mamba
- My problem is not solved with the latest version
Tried in Conda?
I didn't try
Describe your issue
I use micromamba of version 2.1.0 in powershell. When I run micromamba shell init to initialize my powershell profile, I get the following script:
#region mamba initialize
# !! Contents within this block are managed by 'mamba shell init' !!
$Env:MAMBA_ROOT_PREFIX = "C:\Users\chenyulue\micromamba"
$Env:MAMBA_EXE = "C:\Users\chenyulue\micromamba\micromamba.exe"
(& $Env:MAMBA_EXE 'shell' 'hook' -s 'powershell' -r $Env:MAMBA_ROOT_PREFIX) | Out-String | Invoke-Expression
#endregionWhen I start a new powershell, I get the errors as follows:
Invoke-Expression: C:\Users\chenyulue\Documents\PowerShell\profile.ps1:6
Line |
6 | … wershell' -r $Env:MAMBA_ROOT_PREFIX) | Out-String | Invoke-Expression
| ~~~~~~~~~~~~~~~~~
| Unexpected token 'activate' in expression or statement.Then I check the output of $Env:MAMBA_EXE 'shell' 'hook' -s 'powershell' -r $Env:MAMBA_ROOT_PREFIX) | Out-String, and it is:
$MambaModuleArgs = @{ChangePs1 = $True}
Import-Module "$Env:MAMBA_ROOT_PREFIX\condabin\Mamba.psm1" -ArgumentList $MambaModuleArgs
"micromamba" activate base
Remove-Variable MambaModuleArgsThe problem comes from the line "micromamba" activate base, where micromamba is enclosed by quotes. The quotes should not be added. So this may be a bug for the micromamba of version 2.1.0.
The workaround is remove the quotes from the output string with the following script, and the error is gone:
(& $Env:MAMBA_EXE 'shell' 'hook' -s 'powershell' -r $Env:MAMBA_ROOT_PREFIX) | Out-String | foreach {$_.replace('"micromamba"', 'micromamba')} | Invoke-Expressionmamba info / micromamba info
Logs
environment.yml
~/.condarc
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type::bugSomething isn't workingSomething isn't workingwhere::windowsWindows-specific issuesWindows-specific issues