I love the Windows Terminal and if you haven't tried it out yet I highly recommend it. Its super customizable which is absolutely lovely. Here are the steps to add Anaconda Prompt to Windows Terminal.
Prerequisites
- Install Windows Terminal
- Install Anaconda
- Windows 10
Add Anaconda Prompt
- Open Windows Terminal and click the arrow and then
settings
. This will open thesettings.json
file to customize the terminal. - Duplicate the
cmd
settings by copying and pasting them below or highlightCTRL + D
if using visual studio to duplicate the selected text. (I โฅ shortcuts) - Update the
guid
to something unique - Update the
name
toAnaconda
- Next update the
commandline
to the cmd forAnaconda Prompt
. The easiest way to do this is to grab the target path from the Anaconda Prompt shortcut.- Search for
Anaconda Prompt
in the windows search bar - Right click and
open file location
- Right click on the
Anaconda Prompt
shortcut - Click
properties
- Grab the target path
- Delete the extra text to get the path (shown below)
- If you prefer you can replace the "C:\Users\xxx" to "%USERPROFILE%"
The new terminal
settings.json
should look something like this:
- Search for
- Optional: Update the icon to the Anaconda navigator icon
- It will be the same root path as above up to the
anaconda3
- Append
\\Menu\\anaconda-navigator.ico
to the end. - End result should look something like this:
"icon": "%USERPROFILE%\\AppData\\Local\\Continuum\\anaconda3\\Menu\\anaconda-navigator.ico"
- It will be the same root path as above up to the
- Save the changes to the
settings.json
file - Open Windows Terminal
- Click the down arrow and select
Anaconda
- BOOM! Anaconda in Windows Terminal.
- Listen to Sir-Mix-A-Lot and rejoice in your awesomeness
Top comments (27)
In the newest version of Windows Terminal, the changes are done in the settings.json file. Just change USERNAME to yours for the "commandline" setting.
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceee452369}",
"name": "Anaconda",
"icon": "%USERPROFILE%\Anaconda3\Menu\anaconda-navigator.ico",
"commandline": "cmd.exe /K C:\Users\USERNAME\Anaconda3\Scripts\activate.bat",
"hidden": false
},
I updated to settings.json! Thanks!
My username is bsand, so my commandline setting is
"cmd.exe /K C:\Users\bsand\anaconda3\Scripts\activate.bat"
However, the \b is highlighted, I think it is acting as an escape character. Do you have any suggestions?
Try instead
"commandline": "cmd.exe /K C:\\Users\bsand\\anaconda3\\Scripts\\activate.bat"
If you want to have the Anaconda Icon can use this path.
AWESOME! I am going to add this to my setup. Do you mind if I add it into the blog post as well? Thank you :D
No problem! :) Go ahead! Actually thanks for the blog post! :)
(base) C:\Users\navee> this is my actual anaconda prompt
(base) C:\WINDOWS\System32> this is anaconda prompt in windows terminal
in the windows terminal, I'm running anaconda prompt as administrator mode
help me change into the user mode with windows terminal
Can you post the JSON here? For the
startingDirectory
change the JSON to the location you want the directory to open forstartingDirectory
.{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6106}",
"hidden": false,
"icon":"C:\Users\navee\anaconda3\Menu\anaconda-navigator.ico",
"name": "AnacondaPrompt",
"commandline": "cmd.exe /K
C:\Users\navee\anaconda3\Scripts\activate.bat"
},
Not sure if I completely understand. Are you trying to run as admin in win term?
No, I'm not trying to run as admin.... while running in a Windows Terminal by default it's running in admin mode
I tried to change the path also, but every time in windows terminal, the anaconda prompt opening as administrator mode.
Anyways it won't make any difference if I run as administrator mode, so no probs
Thank You Cassie, thanks for ur time n support :)
Add "startingDirectory": "C:\Users\navee" to settings.json file.
Does that solve the problem?
I am facing the same problem is it resolved?
If anyone want to add a Miniconda Powershell prompt add this to the settings.json file:
If you have trouble being creative on step 3 you can just use PowerShell
docs.microsoft.com/en-us/powershel...
@vpraharsha03 I'm experiencing the same issue. @cassieview any idea as to what could be causing this? Thanks for the post! It was very helpful
@jfreeman2 it turned out that i used unnecessary capitalization in the property name. I used
commandLine
instead ofcommandline
cmd.exe
opens up because it is the default value whencommandline
property isn't specified or improperly specified.My miniconda installation was a bit different, and this what ended up working for me.
It is installed at this path "C:\ProgramData\Miniconda3"
the key is changing the guide variable,
my cmd guide is
0caa0dad-35be-5f56-a8ff-afceeeaa6101
I changed the guide by adding one with the last digit of cmd's guide and the rest of the things will be similar.
My anaconda guide is
0caa0dad-35be-5f56-a8ff-afceeeaa6102
is there anyway to add a command to run in the conda environment? I'd like to set up a profile for radian github.com/randy3k/radian which is installed in a conda environment.
Update the command line to the following:
"commandline": "cmd.exe /K %USERPROFILE%\\AppData\\Local\\Continuum\\anaconda3\\Scripts\\activate.bat & radian"
Thanks! I ended up with this actually - specifying the miniconda3 folder specifies the root environment which is not totally necessary in this case but useful if radian isn't in root.
Thanks for the sharing. This is great!
Note for new comer, use double backslash in value of command line.