In this post, we will go over following...

  1. Install Ubuntu On Windows 10
  2. Enable Python Env

Install Ubuntu On Windows

1. Enable the Windows Subsystem for Linux

Open Power Shell on Windows as Administrator and run following command...

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

2. Enable Virtual Machine feature

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

3. Download the Linux kernel update package and install it.

WSL2 Linux kernel update package for x64 machines

4. Set WSL 2 as your default version

Open Power shell and run following command...

wsl --set-default-version 2

5. Open Microsoft Store and search for "Ubuntu" and Install Ubuntu.

6. Restart the Computer

7. Now search for "Ubuntu" and open it. If you didn't see any error, it means Ubuntu distribution is installed successfully.

Note: If you want a fancy terminal, I would suggest either one of the following terminals...

Install Windows Terminal Install Moba Xterm

Enable Python Environment

Once you are in your Ubuntu Shell, do following...

apt-get update

Enable Python Virtual environment...

You should have Python 3+ installed by default.

1. For Conda based virtual environment, check out following tutorial...

Install Anaconda Python On Ubuntu
How to install Anaconda package manager for R and Python

2. For Pip based virtual environment...

apt-get install python3-pip

Let us now create a Python virtual environment...

python3.8 -m venv venv38

Let us enable the environment...

. ./venv38/bin/activate

Now you should see your console change to something like this...

(venv38) (base) 

Now we can install any Python package using pip, Example ...

python -m pip install chalice