Installing Python
Python is preinstalled on Linux- and Mac-based operating systems. However, you will want to install the latest version of Python, which can be done on different operating systems as per the following instructions.
Windows operating system
For Windows, Python can be installed through an executable .exe
file.
- Go to https://www.python.org/downloads/.
- Choose the latest version of Python—currently, it is 3.10.0—according to your architecture. If you have a 32-bit version of Windows, choose the 32-bit installer; otherwise, choose the 64-bit installer.
- Download the
.exe
file. - Open the
python-3.10.0.exe
file. - Make sure to check Add Python 3.10.0 to PATH.
- Click Install Now and then wait until the installation is complete; you can now use Python.
- To verify that Python is installed correctly, open the Command Prompt and type the
python -–version
command. It should outputPython 3.10.0
.
Linux-based operating systems
To install Python on a Linux machine, take the following steps:
- Check whether you have Python preinstalled by entering the
python --version
command in the terminal. - If you do have not a version of Python, then install it through the following command:
sudo apt-get install python3.10
- Now, verify that you have installed Python correctly by typing the
python3.10 --version
command in the terminal. It should outputPython 3.10.0
.
Mac operating system
To install Python on a Mac, take the following steps:
- Go to https://www.python.org/downloads/.
- Download and open the installer file for
Python 3.10.0
. - Click Install Now.
- To verify that Python is installed correctly, open the terminal and type
python –version
. It should outputPython 3.10.0
.