Windows Terminal is one of the very few things likable about Windows when it comes to developers. It is customize-able and fun.
By default Anaconda Prompt is not one of the available terminal profiles in Windows Terminal. So if you have installed Python through Anaconda, it can be very tedious to switch between terminal applications to issue Python commands. However it is completely possible to set up Anaconda prompt as part of the Windows Terminal, which allows to open Anaconda Terminal as new tab in the Terminal application.
This article assumes that Windows terminal and Anaconda are already installed.
Add Anaconda prompt to Windows Terminal
- Open Windows Terminal
- Press
Ctrl+,
. This will open Settings Tab. Copy the
cmd
setting (look for "name" : "Command Prompt") and paste it just above (or where you want) the existing code block.
-
Next change the following in the copied block. Remember it is in the key: value format:
-
guid
: Change it anything unique. Ex: change the last 5 letters/digits -
name
: Name it toAnanconda Prompt
-
commandline
: This is the path that should point to the Anaconda bat file. Generally this is located at following location:"C:\\Users\\XXXX\\anaconda3\\Scripts\\activate.bat\"
. ReplaceXXXX
with your User Name. - In case you cannot find the Anconda .bat file in the above specified location; search for Anaconda in Windows Search Bar.
- Right click and Open File location
- On the Anaconda Prompt shortcut, right click and select properties.
- Next copy the .bat part of the path specified in the
Target
dialogue box. - Next replace the value of
commandline
: "cmd.exe /K C:\Users\XXXX\anaconda3\Scripts\activate.bat\"
-
Save the
Settings.JSON
.Go to the Windows Terminal and point to the down arrow there should now be an option for "Anaconda Prompt".
Problematic Part: In case you have a space in the anaconda activate.bat, then you will get Syntax error thrown after saving the Settings.JSON file. Generally this happens when people have spaces in their user name. In that case modify the
commandline
value as "cmd.exe /K \"C:\Users\User Name with Space\anaconda3\Scripts\activate.bat \""
Top comments (0)