loader

Setting up #WindowsTerminal for Data Science

Hi everyone,

Just a short blog to show you how to get the new Windows Terminal set up for a few common Data Science workloads.

When Windows Terminal was announced at Microsoft Ignite, we were super excited to give it a go - I never got around to cloning it from GitHub and getting it set up and now I do not need to. Over the weekend the Windows Terminal (preview) became available in the Microsoft Store (open the store and search for Windows Terminal).

Here are a few things I always do as a Data Scientist / Machine Learning Engineer:

  • Open a Python session and run a script during development and testing.

  • Open an Anaconda Prompt session and use Conda environments

  • Containerise my Machine Learning with Docker.

When working on an end-to-end project I typically have a huge number of terminals open. Windows Terminal lets you have multiple terminal windows configured to each of your environments all running in the same window!

Once you have the Terminal installed then all you need to do it open the configuration file.

1.png

When you scroll down to "schemes" this is where you will see 2 defaults for PowerShell and CMD. Now to add any new terminals, all you need to do is copy and paste one of the blocks and start making some changes.

Adding Anaconda Prompt.

I use Anaconda Prompt whenever I need to launch a Python session and also for managing my Conda environments, but I hate having multiple terminals open when I am working. Problem solved.

Copy the CMD block and make the following changes:

"commandLine": "cmd.exe" -> "commandLine": "cmd.exe /k C:\\ProgramData\\Anaconda3\\Scripts\\activate.bat"
Might be different on your machine. Copy the link from the shortcut.

"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6102}" -> "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6103}"
(I made up a new one)

"icon": "" -> "icon": "<location of your icon>" Point this to a new Icon

"name": "command" -> "name": "Anaconda" Give it a new name.

3.png

You can also change the style by changing the reference in colorScheme.

That is all there is to it. You do no even need to close and reopen, a new options should just be there.

Do this for any additional terminals you use and you're all set.

The ability to add custom backgrounds is awesome! Thanks to Scott Hanselman for the tip (https://www.hanselman.com/blog/YouCanNowDownloadTheNewOpenSourceWindowsTerminal.aspx)

 

Happy Pride Month!

Happy Pride Month!

 

 

author profile

Author

Terry McCann