![Invoke-Expression conda powershell 提示符](https://linux22.com/image/1602937/Invoke-Expression%20conda%20powershell%20%E6%8F%90%E7%A4%BA%E7%AC%A6.png)
我安装了 Anaconda 4.7.11,现在遇到了问题。当我启动 conda 提示符(以管理员身份运行或不以管理员身份运行)时,它给我带来了麻烦。
Invoke-Expression : At line:1 char:1523
+ ... n\Scripts;D:\python;D:\python;D:\workspace_py;"C:\WINDOWS\system32;""
+ ~~~~~~~~~~~~~~~~~~~
Unexpected token 'C:\WINDOWS\system32' in expression or statement.
At D:\Anaconda\shell\condabin\Conda.psm1:101 char:9
+ Invoke-Expression -Command $activateCommand;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
+ FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand
所以我看了看 psm1,发现这一行
begin {
$OldPath = Add-Sys-Prefix-To-Path;
If ($Stack) {
$activateCommand = (& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA shell.powershell activate --stack $Name | Out-String);
} Else {
$activateCommand = (& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA shell.powershell activate $Name | Out-String);
}
$Env:PATH = $OldPath;
Write-Verbose "[conda shell.powershell activate $Name]`n$activateCommand";
Invoke-Expression -Command $activateCommand;
}
101 是 Invoke-Expression -Command $activateCommand;
我不知道问题出在哪里。有没有人遇到过同样的问题并解决了?