access_time 12 months ago languageEnglish
more_vert

Install Python 3.9.1 on WSL

visibility 11,236 comment 9
This article summarizes the steps to install Python 3.9.1 on Windows Subsystem for Linux Debian distro. You can also apply them to other similar distros.  Run the following commands in your WSL terminal. 1) Update package lists sudo apt update 2) Install dependent libraries sudo apt ...
info Last modified by Raymond 12 months ago
thumb_up 13

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

comment Comments
2 months ago link more_vert
G Glenn
articleArticles 0
imageDiagrams 0
codeCode 0
chat_bubble_outlineThreads 0
commentComments 2
loyaltyKontext Points 2
#1735 Re: Install Python 3.9.1 on WSL

Ah, then this has nothing to do with WSL, then. It's "how to install a python version higher than that bundled with the distro". This would happen in regular Debian as well.

format_quote

person Raymond access_time 2 months ago
Re: Install Python 3.9.1 on WSL

Hi, it is because the package is not available directly at the time when this article was published.

2 months ago link more_vert
Raymond Raymond
articleArticles 546
imageDiagrams 49
codeCode 2
chat_bubble_outlineThreads 8
commentComments 250
loyaltyKontext Points 6005
account_circleProfile
#1734 Re: Install Python 3.9.1 on WSL

Hi, it is because the package is not available directly at the time when this article was published.

format_quote

person Glenn access_time 2 months ago
Re: Install Python 3.9.1 on WSL

I don't understand why you would build python from source.

On WSL Debian bullseye:

glenn@RainbowDream:~$ sudo apt-get install python3
Reading package lists... Done
Building dependency tree... Done
The following additional packages will be installed:
  ca-certificates libexpat1 libmpdec3 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libsqlite3-0
  media-types openssl python3-minimal python3.9 python3.9-minimal
Suggested packages:
  python3-doc python3-tk python3-venv python3.9-venv python3.9-doc binutils binfmt-support
The following NEW packages will be installed:
  ca-certificates libexpat1 libmpdec3 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libsqlite3-0
  media-types openssl python3 python3-minimal python3.9 python3.9-minimal
0 upgraded, 13 newly installed, 0 to remove and 7 not upgraded.
Need to get 7,027 kB of archives.
After this operation, 23.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

followed by the download and install and to prove the point:

glenn@RainbowDream:~$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.

2 months ago link more_vert
G Glenn
articleArticles 0
imageDiagrams 0
codeCode 0
chat_bubble_outlineThreads 0
commentComments 2
loyaltyKontext Points 2
#1733 Re: Install Python 3.9.1 on WSL

I don't understand why you would build python from source.

On WSL Debian bullseye:

glenn@RainbowDream:~$ sudo apt-get install python3
Reading package lists... Done
Building dependency tree... Done
The following additional packages will be installed:
  ca-certificates libexpat1 libmpdec3 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libsqlite3-0
  media-types openssl python3-minimal python3.9 python3.9-minimal
Suggested packages:
  python3-doc python3-tk python3-venv python3.9-venv python3.9-doc binutils binfmt-support
The following NEW packages will be installed:
  ca-certificates libexpat1 libmpdec3 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libsqlite3-0
  media-types openssl python3 python3-minimal python3.9 python3.9-minimal
0 upgraded, 13 newly installed, 0 to remove and 7 not upgraded.
Need to get 7,027 kB of archives.
After this operation, 23.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

followed by the download and install and to prove the point:

glenn@RainbowDream:~$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.

3 months ago link more_vert
Raymond Raymond
articleArticles 546
imageDiagrams 49
codeCode 2
chat_bubble_outlineThreads 8
commentComments 250
loyaltyKontext Points 6005
account_circleProfile
#1721 Re: Install Python 3.9.1 on WSL

I'm glad that you find it helpful :)

format_quote

person Alexander access_time 3 months ago
Re: Install Python 3.9.1 on WSL

Thank you! Super useful

4 months ago link more_vert
Raymond Raymond
articleArticles 546
imageDiagrams 49
codeCode 2
chat_bubble_outlineThreads 8
commentComments 250
loyaltyKontext Points 6005
account_circleProfile
#1695 Re: Install Python 3.9.1 on WSL

You are welcome! If you have other related questions, feel free to post it here.

format_quote

person Cathy access_time 4 months ago
Re: Install Python 3.9.1 on WSL

Thanks so much for getting back to me! I cant find the pip3 executable, but I have been able to install modules with:

python -m pip install [module_name]


4 months ago link more_vert
C Cathy
articleArticles 0
imageDiagrams 0
codeCode 0
chat_bubble_outlineThreads 0
commentComments 2
loyaltyKontext Points 2
#1694 Re: Install Python 3.9.1 on WSL

Thanks so much for getting back to me! I cant find the pip3 executable, but I have been able to install modules with:

python -m pip install [module_name]


format_quote

person Raymond access_time 4 months ago
Re: Install Python 3.9.1 on WSL

Hi Cathy,

From Python 3.4, pip is included as part of Python installation binary.

Can you try the following command?

pip3

OR

python -m pip

If you find the pip is not installed by default, try using the following command to install it:

python -m ensurepip --default-pip

Reference:

Installing Python Modules — Python 3.10.6 documentation

4 months ago link more_vert
Raymond Raymond
articleArticles 546
imageDiagrams 49
codeCode 2
chat_bubble_outlineThreads 8
commentComments 250
loyaltyKontext Points 6005
account_circleProfile
#1692 Re: Install Python 3.9.1 on WSL

Hi Cathy,

From Python 3.4, pip is included as part of Python installation binary.

Can you try the following command?

pip3

OR

python -m pip

If you find the pip is not installed by default, try using the following command to install it:

python -m ensurepip --default-pip

Reference:

Installing Python Modules — Python 3.10.6 documentation

format_quote

person Cathy access_time 4 months ago
Re: Install Python 3.9.1 on WSL

Where is pip? It does not seem to be installed

recommendMore from Kontext