29th March 2024

How to Install Python in Windows and Ubuntu?

In order to develop programs with Python, you must have the corresponding version of Python installed on your computer. Most Linux distributions come with Python installed. Ubuntu comes with Python 2 and 3 installed. It is also installed on the Mac operating system. However, if you are using Windows, you need to install Python yourself.

Installing Python 3 on Windows 10

To install Python 3 on your Windows 10 operating system, you will need to download the latest Python 3, Python 3.8.1 installation file. You can use the download link for 64-bit processors and the link for computers with 32-bit processors.

Download python for windows
Download python for windows

After the download is complete, we run the .exe file as it loads a normal program. When we run the file, we will see a screen like below.

Python 3.8.1 install
Python 3.8.1 install

Here you should note that the detay Add Python 3.8 to PATH ”option is selected in the lower part. The purpose of selecting this option is to enable Python to be defined on the Windows command line system. Normally, after selecting and installing this option, Python operations will be allowed on the command line screen. But until the selection and installation process is done, you will see a screen like the one below. To try this, just open the command line and type python on the screen that opens and press enter.

Python Install Now
Python Install Now

But until the selection and installation process is done, you will see a screen like the one below. To try this, just open the command line and type python on the screen that opens and press enter.

LEARN MORE  Apache Log4j Vulnerability - CVE-2021-44228
python install control
python install control

Here, the Python installation is in progress, and the installation will end in a short time.

Python setup progress
Python setup progress

 

To continue the installation, select ‘Add Python 3.8 to PATH’ and then click Install Now. Normally, the installation is completed without any problems, you will see a screen like the following.

Python setup was seccessful
Python setup was seccessful

Now, in order to understand the situation in the command line in a more detailed way, let’s open the command line and write the python command and look at the screen in more detail and write a few python commands on this screen.

Command Prompt - python
Command Prompt – python

As you can see, now we can write python commands on the command line screen. As an example, I have provided you to see more details with a few commands. Now let’s try these commands on IDLE, which comes with Python. To access IDLE, simply type IDLE in the start screen.

IDLE in the start screen
IDLE in the start screen

Run the program and the command line that I have written on this screen when you try to see that there is no difference.

python 3.8.1 Examples in Shell
python 3.8.1 Examples in Shell

We have installed and run Python 3.8.1. Now we will install Python on Ubuntu.

Installing Python 3 on Ubuntu

On Linux operating systems, python versions 2 and 3 are usually installed. You can check the version of python2 from the terminal with the command “python –version” and the installed version of python3 with the command “python3 –version”. If python is not installed on your system, you can install it with the command below.

python version
python version

Installing python 3 and python 2 is done as follows. My ubuntu operating system had pyyhon 3 but no python 2.

python 3 and python 2 install
python 3 and python 2 install

Now, let’s open the command line on Ubuntu, write the python command, look at the screen in more detail and write the example we did on this screen.

LEARN MORE  How to Update Timezone on php.ini?
Python command on ubuntu
Python command on ubuntu

 

Leave a Reply

Your email address will not be published. Required fields are marked *