Installing or updating Python on your computer is the first step to becoming a Python programmer. There are a multitude of installation methods: you can download official Python distributions from Python.org, install from a package manager, and even install specialized distributions for scientific computing, Internet of Things, and embedded systems.
This tutorial focuses on official distributions, as they’re generally the best option for getting started with learning to program in Python.
In this tutorial you’ll learn how to:
- Check which version of Python, if any, is installed on your machine
- Install or update Python on Windows, macOS, and Linux
- Use Python on mobile devices like phones or tablets
- Use Python on the Web with online interpreters
No matter what operating system you’re on, this tutorial has you covered. Find your operating system below and dive in!
Free Bonus: Click here to get a Python Cheat Sheet and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.
How to Install Python on Windows#
There are three installation methods on Windows:
- The Microsoft Store
- The full installer
- Windows Subsystem for Linux
In this section, you’ll learn how to check which version of Python, if any, is installed on your Windows computer. You’ll also learn which of the three installation methods you should use.
How to Check Your Python Version on Windows#
To check if you already have Python on your Windows machine, first open a command-line application, such as PowerShell.
Tip: Here’s how you open PowerShell:
- Press the Win key.
- Type
PowerShell
. - Press Enter.
Alternatively, you can right-click the Start button and select Windows PowerShell or Windows PowerShell (Admin).
You can also use cmd.exe
or Windows Terminal.
With the command line open, type in the following command and press Enter:
C:\> python --version
Python 3.8.4
Using the --version
switch will show you the version that’s installed. Alternatively, you can use the -V
switch:
C:\> python -V
Python 3.8.4
In either case, if you see a version less than 3.8.4
, which was the most recent version at the time of writing, then you’ll want to upgrade your installation.
Note: If you don’t have a version of Python on your system, then both of the above commands will launch the Microsoft Store and redirect you to the Python application page. You’ll see how to complete the installation from the Microsoft Store in the next section.
If you’re interested in where the installation is located, then you can use the where.exe
command in cmd.exe
or PowerShell:
C:\> where.exe python
C:\Users\mertz\AppData\Local\Programs\Python\Python37-32\python.exe
Note that the where.exe
command will work only if Python has been installed for your user account.
What Your Options Are#
As mentioned earlier, there are three ways to install the official Python distribution on Windows:
Read the full article at https://realpython.com/installing-python/ »
[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]
from Real Python
read more
No comments:
Post a Comment