Introduction
When installing Anaconda in Windows, it is common to not add its executables' location to the system PATH. In this case, we would usually run Python from the Anaconda Prompt:
This post is about how to add Anaconda Prompt to Windows Terminal.
Prerequisites
- Windows 10
- Windows Terminal
- Anaconda
Add Anaconda Prompt
Open the settings of Windows Terminal:
This will open the configuration file of Windows Terminal in an editor (VS Code in my case):
Add the following under the profiles.list array (change the paths accordingly):
{
"commandline" : "powershell.exe -ExecutionPolicy ByPass -NoExit -Command \"& 'C:\\Users\\li_ru\\anaconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate 'C:\\Users\\li_ru\\anaconda3' ; cd ~ \" ",
// Make changes here to the Anaconda Prompt profile.
"guid" : "{01234567-35be-5f56-a8ff-afceeeaa6101}",
"hidden" : false,
"icon" : "C:\\Users\\li_ru\\anaconda3\\Menu\\Iconleak-Atrous-PSConsole.ico",
"name" : "Anaconda Prompt"
}
If you want this to be the default profile, then also add the following:
"defaultProfile" : "{01234567-35be-5f56-a8ff-afceeeaa6101}"
Note that you can change the guid, just make sure it is unique.
Comments