1

I installed Anaconda 4.7.11 and have a problem now. When I started the conda prompt(run as administrator or not), it throws me a trouble.

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

So i looked at the psm1 and the line is

 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;
    }

and the 101 is Invoke-Expression -Command $activateCommand;

I can't know what the problem is. Is there anyone who had the same problem and fixed it?

0 Answers0