Home / Computer Science / Python / Python Installation and Environment Setup

Python Installation and Environment Setup

Python Installation Checking:

As python is most widely used language so before installing python in PC you must check if the PC has already python or not.

To check python installation, type the below command in command prompt in windows.

Vesrion of Python
          Python Version checking


C:\Users>python --version
Python 3.7.4

If you want to check in Linux or Mac.

Python – version

Python Execution:

Python is interpreted programming language, as a developer write code in note pad and save file with extension of .py (dot py), and then put those file into the python interpreter and execute like below.

C:\Users>python firstpython.py

Here firtspython.py is the file name.

The file fisrtpython.py contains below code.


print ("Welcome to python programming")


C:\Users\gadagammasantosh\Music>python FirstPython.py
Hi! welcome to python programming

Python Output
                                              Python Output

C:\Users\gadagammasantosh\Music>

If you type exit() then the terminal will be closed.

If the python not installed in your PC get the windows installer from the source
Download here

Python Environment Setup:

Python installation on Windows: Python is available freely on the www.python.org/downloads Download here and choose suitable downloaded version for your system.
For windows there is an windows installer (.exe file) choose that click on download.

 

Python downloads
                                                                                       Python downloads Page

By double click run the downloaded file and you will get the below screen.
Then check the “Add Python 3.7 to Path” it is mandatory otherwise we need to configure it manually.

Add Python Path
                                                                    Add Python to system Path

If you select Customized option, then the screen looks like below select what you want and click on Next

Python Optional Features
                                                              Python Optional Features while installation

 

Select the features what you want to install and click on Install.

 

Python - Advanced Options
                                                                        Python – Advanced Options

 

The python setup will installed and it shows in progress.

 

Python -Setup Progress Bar
                                                                        Python -Setup Progress Bar

 

To check whether it is installed on your system, go to command prompt and type “Python” like below.

Installation in Linux:

Follow the below commands in your environment.
First confirm python is available in your Linux machine by using the below command

$python –version

If python is available, it shows version details otherwise it says not found then follow below steps to install

$sudo apt-get install python3.7

Then the python is download into your machine.

Like the same way installation can be done in Mac and iOS machines.

About Santosh Kumar Gadagamma

I'm Santosh Gadagamma, an Experienced Software Engineer passionate about sharing knowledge in technologies like Java, C/C++, DBMS/RDBMS, Bootstrap, Big Data, Javascript, Android, Spring, Hibernate, Struts, and all levels of software design, development, deployment, and maintenance. I believe computers are essential for the world's functioning, and I'm committed to helping others learn the skills they need to succeed in tech. My website is a valuable learning tool to help you reach greater heights in your education and career, and I believe that education has no end points.

Check Also

Interview Questions for Python Strings

Unleashing the Power of Python Strings: Advanced Methods for String Manipulation

In this blog post, we will explore advanced methods for python strings that expand your …