How to Install Python on Windows WSL - A Passionated System Admin's Blog (2024)

In this post, I’ve outlined the steps for installing specific versions of Python on WSL in an easy-to-follow manner.

1. Install Windows Subsystem for Linux and Install Distro

In the Run dialog box, type optionalfeatures and press Enter. A window displaying Windows features will appear. Select ‘Windows Subsystem for Linux‘ from the list, proceed with the installation, and restart the system once the installation is complete.

Once the system is rebooted, in the command prompt, type

wsl.exe –list –online

which will list the available distros. From there, I will select the Ubuntu install.

wsl.exe –install Ubuntu

Once the installation is is finished, you’ll need to define the user name and password.

Anytime you can start the WSL system in the command prompt by typing wsl.exe in the command prompt.

[Resetting the WSL root password]

If you want to reset the password, you will need to start the WSL with the following command:

wsl.exe -u root

passwd root

2. Install Required package for Python

Since we’re going to install python by compiling source files, we’d need to install some dependencies packages like compiler and openssl. First update, the respository and links.

sudo apt upgrade

Install Compilers and packages.

sudo apt-get install libssl-dev openssl make gcc

3. Python Installation

We will download the python from official python site. From there you can select the specific version you want. Here I’ll go with the python3.8.9

Download the python and extract the files.

cd /mnt

wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz

tar xzvf Python-3.8.9.tgz

cd Python-3.8.9/

Now we will have a make file with the configure command which checks system configuration and sets up the build environment accordingly. The process takes some time, so be patient.

./configure

Here, we got the Make file, so now compile the source code and install binaries to the system with the following command.

sudo make install

4. Install Pip (Optional)

pip is an essential tool for Python development as it simplifies the process of managing external libraries and dependencies, making it easier to work with third-party packages and extend the capabilities of your Python projects. You can install it by:

sudo apt install python3-pip

How to Install Python on Windows WSL - A Passionated System Admin's Blog (2024)
Top Articles
What Is Risk Tolerance And Why Is It Important? | Bankrate
How Much is Motorcycle Insurance?
What Is Single Sign-on (SSO)? Meaning and How It Works? | Fortinet
How To Fix Epson Printer Error Code 0x9e
Yogabella Babysitter
Is pickleball Betts' next conquest? 'That's my jam'
The Daily News Leader from Staunton, Virginia
Mlifeinsider Okta
Jscc Jweb
MindWare : Customer Reviews : Hocus Pocus Magic Show Kit
Lonadine
OpenXR support for IL-2 and DCS for Windows Mixed Reality VR headsets
Best Fare Finder Avanti
Help with Choosing Parts
Binghamton Ny Cars Craigslist
TS-Optics ToupTek Color Astro Camera 2600CP Sony IMX571 Sensor D=28.3 mm-TS2600CP
Highland Park, Los Angeles, Neighborhood Guide
Nhl Wikia
Georgia Vehicle Registration Fees Calculator
Richland Ecampus
Labby Memorial Funeral Homes Leesville Obituaries
ABCproxy | World-Leading Provider of Residential IP Proxies
Isaidup
Dcf Training Number
Parc Soleil Drowning
The Many Faces of the Craigslist Killer
Understanding Gestalt Principles: Definition and Examples
Gs Dental Associates
Bj타리
Rlcraft Toolbelt
Delta Rastrear Vuelo
Autotrader Bmw X5
Craigslist Dallastx
MethStreams Live | BoxingStreams
In Branch Chase Atm Near Me
Unity Webgl Player Drift Hunters
USB C 3HDMI Dock UCN3278 (12 in 1)
Discover Wisconsin Season 16
Jasgotgass2
Restored Republic June 6 2023
Xxn Abbreviation List 2023
Worcester County Circuit Court
Luvsquad-Links
How to Connect Jabra Earbuds to an iPhone | Decortweaks
Jigidi Free Jigsaw
Union Supply Direct Wisconsin
Used Sawmill For Sale - Craigslist Near Tennessee
Used Auto Parts in Houston 77013 | LKQ Pick Your Part
53 Atms Near Me
Read Love in Orbit - Chapter 2 - Page 974 | MangaBuddy
Equinox Great Neck Class Schedule
Wayward Carbuncle Location
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6266

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.