What is the difference between Anaconda Prompt and Anaconda Powershell Prompt?
First, for everything from executing python related commands (python
, ipython
, jupyter
, conda
, etc.) to running Python scripts (e.g. python helloworld.py
), there is no difference. So there is no worry ;)
And then, the only difference, as the name suggests, is the windows shell environment in which you running conda
commands: cmd.exe
(Command Prompt) vs powershell.exe
.
Now let's talk a bit more about the difference: (reference)
Briefly, the
cmd.exe
is a simple shell introduced with Windows NT with the same basic syntax and functionality as DOS. It has relatively limited capabilities, especially when compared to Unix/Linux shells.And PowerShell is a modern shell implementation with all sorts of extra goodies (e.g. commands colorful highlight).
So, in Anaconda Powershell Prompt, you can run some powershell commands like these:
> $PSVersionTableName Value---- -----PSVersion 5.1.18362.752PSEdition DesktopPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}BuildVersion 10.0.18362.752CLRVersion 4.0.30319.42000WSManStackVersion 3.0PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1> $env:PATHC:\Users\user-name\anaconda3;C:\Users\user-name\anaconda3\Library\mingw-w64\bin;...
But in Anaconda Prompt, above commands would not be recognized, you can run this though:
>verMicrosoft Windows [版本 10.0.18363.815]
And under the hood, Anaconda Powershell Prompt and Anaconda Prompt just two shortcuts invoking different commands:
%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -NoExit -Command "& '%USERPROFILE%\anaconda3\shell\condabin\conda-hook.ps1' ; conda activate '%USERPROFILE%\anaconda3' "
%windir%\System32\cmd.exe "/K" %USERPROFILE%\anaconda3\Scripts\activate.bat %USERPROFILE%\anaconda3
Windows offers two command line environments, the traditional "Prompt" (cmd.exe
) and the newer "PowerShell". You can use Anaconda with either of these.
The documentation for Windows commands covers both.