In this Python tutorial, We will discuss Python download and installation steps. Also we will cover below things.:
- Download Python
- How to install python on windows 10/11?
- How to install python on Linux?
- Install Python 3.6 on Ubuntu 16.10 and 17.04
- How to install Python 3.8 on Ubuntu?
- Python 3 Installation on mac
- How to Install Python 3 on CentOS 7?
- How to Uninstall Python 2.7
- Python disable path length limit
You can also check a very good article in How does python work?.
If you want to learn Python and machine learning, check out Python and Machine Learning Training Course.
How to install python on windows?
Let’s discuss, Python 3.8.2 download and installation in Windows 10. Please follow the below steps to do so.
Step-1:
Open the Python official site for downloading the python updated version. The current version in April 2020 is 3.8.2.
Step-2:
Now click on the “Windows” link to download the python version for windows.
Step-3:
From Python stable version 3.8.2 version section, Click on Download “Windows x86-64 executable installer”. Now Python-3.8.2-amd64.exe file will get download. Copy that file to your desktop or some other location.
Step-4
Now double click on the downloaded file.The below window will open. Click on “Install now“.
Ensure that the Install launcher for all users (recommended) and the Add Python 3.8 to PATH check boxes at the bottom are checked.
Step-5:
Do you want to allow this app to make changes to your device. Please click on yes option.Then the installation will start.
Step-6:
Now the below pop up window will open saying “Setup is successful”.
Step-7:
If you will search for Python in your machine, Python 3.8 (64-bit) will display. Now if you will double click on that below terminal will open.
Now let’s check what is the exact python version installed in my system. To check that I entered the below command
python --version
But unfortunately, I got the below error
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
NameError: name ‘python’ is not defined
Now why this error?
Actually, We are trying to start the Python interpreter by running the command “python”.
However the interpreter is already started. It is interpreting python as a name of a variable, and that name is not defined here so it is showing “name python is not defined”.
But don’t worry python is installed correctly. To verify that, what I did is I entered print(“pythonguides”) and I got the expected output as “pythonguides”.
Now in two ways we can see the python version in this case
1- Please enter the below line of codes in the python terminal
import sys
mypythonversion = 0x600
mypythonversion = sys.version[:5]
print("%s%s" %("my python version is: ", mypythonversion))
Now see the below screen shot, It is showing my python version is “python 3.8.2”.
2- The other approach here to see the python version is to open the system command prompt and enter the below command. You can see the it will display the version is Python 3.8.2.
python --version
Read Beginner’s Guide To Programming
How to install python on Linux?
Please follow the below steps to do Python download and installation on Linux.
You should install the build-essentials, bzip2, SQLite as a prerequisite, If you are building this software for the first time in your system as it’s mandate or else you will get errors during installation of python. If you have already done it before then you can ignore the below three steps.
Step-1:
Open the terminal and enter the command “sudo apt-get install build-essential”.This will install all the build essentials in your system.
Step-2:
Now on the terminal enter the command “Sudo apt-get install libbz2-dev”. This will install bzip2 support which is needed.
Step-3:
Now on the terminal enter the command “Sudo apt-get install libsqlite3-dev”. This will install SQ Lite support which is also needed.
So Now you are done with the prerequisite. Now follow the below steps
Step-1:
Open the Python official site for downloading the python updated version. The current version in April 2020 is 3.8.2. But it’s up to you which version you want to download.
Click on the “Linux\Unix” link and download the needed version.
Step-2:
There will be many versions so click on the version you need. It will be downloaded as Python-version and save it in your local folder. Double click on that it will extract and copy to the folder Python-version.
Note: Version here is the version of python you downloaded (Ex : 3.8.2 so you folder \file name will be Python-3.8.2)
Step-3:
Now open the terminal then enter the below command. Now it will point to the folder where your downloaded file is present.
CD Python-version
Step-4:
Now type the below command and press enter and wait for some time. Once the system will check everything then you go to the next step.
./configure
Step-5:
Now enter the below command and press enter.Linux will make the python software.
make
Step-6:
Now in your terminal enter the below command. Which will install Python in your system.
sudo make altinstall
Note: Few commands may be different based on your Linux version.
Read Complete Guide To Artificial Intelligence
Install Python 3.6 on Ubuntu 16.10 and 17.04
Let’s discuss how we can install Python 3.6 on Ubuntu 16.10 and 17.04. Python 3.6 is by default present there in the repository of Ubuntu 16.10 and 17.04. So please follow the below steps to find the update and install python 3.6.
Step-1:
First open the terminal in your system.
Step-2:
Now check the update. Please use the below command for the same
sudo apt update
Step-3:
Use the below command to install python 3.6 on your machine.
sudo apt install python3.6
Step-4:
Now to make sure the correct version is installed in your machine. You can check the version of python using the below command.
python3.6 -V
You will get the out put as below
Python 3.6.0
How to install Python 3.8 on Ubuntu, Centos?
Let’s discuss Python 3.8 download and installation steps on Ubuntu. 3.8.2 is the latest version now(April 2020). Please follow the below steps for the same.
Before going to the actual installation We need to install the prerequisites else it will show you so many errors during installation.
Step-1:
Open the terminal and run the below commands.This will download and install the packages needed for the installation.
sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
Step-2:
Open the Python official site for downloading the python 3.8 version. Click on the “Linux\Unix” link and download the 3.8 version.
Step-3:
It will be downloaded as Python-version and save it in your local folder. Double click on that it will extract and copy to the folder Python-3.8.
Step-4:
Now open the terminal then enter the below command. Now it will point to the folder where your downloaded file is present.
CD Python-3.8
Step-5:
Now type the below command and press enter and wait for some time. Once the system will check everything then you go to the next step.
./configure
Step-6:
Now in your terminal enter the below command. Which will install Python in your system.
sudo make altinstall
Step-7:
Now to make sure the correct version is installed in your machine. You can check the version of python using the below command.
python3.8 -V
You will get the below output.
Python 3.8.2
Python 3 Installation on mac
Let’s discuss here how to install Python 3 on macOS? Before going to the actual installation we need to install some prerequisites needed.
Step-1:
Open your terminal and type the below command to install XCode. Which is needed.
xcode-select --install
Step-2:
Now we need to install Homebrew.To install this, run the below command in your terminal
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step-3:
Now open your terminal and type the below command that will install the latest version of python 3 in your mac
brew install python3
Step-4:
To confirm the version of the python installed in your mac, please type the below command
python3 --version
It will show the latest python version as the output.
How to Install Python 3 on CentOS 7?
Let’s discuss here how to install Python 3 via the CentOS 7 package manager Yum.In Centos 7.7, Python 3 is available in the repository. So let’s follow the below steps
Step-1:
To update the environment, Please use the below command.
yum update -y
Step-2:
Now we need to do the actual installation of python.To do so please use the below command.
yum install -y python3
Step-3:
Now to make sure python3 got installed correctly, Please run the below command. That will show you the python3 version installed in your machine.
python3
Install Python 3.8 on CentOS 7 / CentOS 8
Let’s discuss here on Python 3.8 download and installation steps on Centos 7 / Centos 8. Please follow the below steps to do so.
Step-1:
We need to install the packages needed before the actual installation of python. To do that please run the below commands.
sudo yum -y groupinstall "Development Tools"
sudo yum -y install openssl-devel bzip2-devel libffi-devel
Step-2:
Open the Python official site for downloading the python 3.8 version. Click on the “Linux\Unix” link and download the 3.8 version.
Step-3:
It will be downloaded as Python-version and save it in your local folder. Double click on that it will extract and copy to the folder Python-3.8.
Step-4:
Now open the terminal then enter the below command. Now it will point to the folder where your downloaded file is present.
CD Python-3.8
Step-5:
Now type the below command and press enter and wait for some time. Once the system will check everything.
sudo ./configure --enable-optimizations
Step-6:
Now in your terminal enter the below command. Which will install Python in your system.
sudo make altinstall
Step-7:
Now to verify that you have installed the python 3.8 version correctly. Please use the below command.
python3.8 --version
You will get the below output
Python 3.8.2
Now we are don with the installation of python 3 in different operating systems. So the next that we need to start the development activities is we need to install one IDE or code editor where we will write and execute our code.
Python IDEs and Code Editors
We will discuss about the different python IDEs and code editors needed for the development of python.
What are IDEs and Code Editors?
When we start working with any of the programming languages, We need some tools or editors where we need to write and execute our programs.
IDE is nothing but an “Integrated Development Environment”. This is a software that is designed for software development. This tool helps to write, design, debug the code easily.
When you are getting an error you can put a debugger and check line by line where the issue is from. Not only this much, An IDE will highlight the code and has auto-suggestion features etc.
Where as the code editors are simple text editors which can highlight the code syntax as well as can format your code easily.
There are few good code editors that can support the debugging as well.
If you are using python for a normal programming purpose then you can choose a good code editor instead of going for an IDE. But if you are building any complex project using python then IDE is the best choice.
There are many IDEs and code editors are available in the market. Some are for general purpose and supports many languages and few you can only use for python development.
1- PyCharm:
Pycharm is one of the best development IDE for python.
This IDE has lots of good features like Code editor, Error highlighting capability, Code debugging capability,supports source controls as well.
Pycharm is available in both paid (Professional) and free open-source (Community) editions.
This is one of the simple IDE and supports in Windows,Linux and Mac platforms.
Let’s discuss the steps to install pycharm community version 2020.1 which is free in Windows 10.
Step-1:
Download the Pycharm executable file from the official site. Click on the “Download” button under the community option.
Step-2:
Python-community-2020.1 file will get downloaded. Copy to a proper location for example desktop or any drive and then double click on that file. Click yes when it will ask “Do you want to allow this app to make changes to your device?”
Step-3:
The below popup will appear, Please click on next.
Step-4:
Now the below pop up will appear, Please click on next button again.
Step-5:
Now you will see the below pop up and check the checkbox 64-bit launcher if you want a desktop short cut and then click next.
Step-6:
Now see the below pop up choose JetBrains and click on install
Step-7:
Now you can see the installation in progress. Please wait for it to complete 100%.
Step-8:
Now if you want to run the Pycharm community version immediately you can check the option or else click on Finish button.
Step-9:
Now your installation is done.Search for Pycharm in your computer and click on that you will get the below popup. Check the check box and click on continue.
Step-10:
The below popup will appear. Click on don’t send button.
Step-11:
Now the IDE will open like below just click on “skip remaining set defaults” button.
Step-12: Congratulation, Now here is the Pycharm IDE version 2020.1.
2- Spyder
One of the best thing in case of Spyder is, It is an open source Python IDE.
Spyder has all the common features which all the IDEs are providing such as code editing, Syntax highlighting, Auto-completion, etc.
Spider is mainly targeted for data scientists using python as It integrates well with common Python data science libraries like SciPy, NumPy, etc.
It looks very simple and easy to use for python development.
3- Visual Studio
Visual studio is one more IDE which is from Microsoft. This is a very reach IDE with all the features like code editor, Highlighting the errors, Autocomplete, Intellisense support, Debugging feature and many more.
This is and IDE with fully loaded feature. You can do what ever you want with this IDE.
This is not only for python it supports other language like Microsoft .Net etc.
Both free version(Community) and paid versions( Professional and Enterprise) are available for visual studio. The current version vs is 2019 as of now.
4- Visual studio code
Visual studio code is a code editor which you can use for python development.This is not only mean for python, It supports other languages also.
Mainly uses for many scripting language as well as for share point framework development purposes.
One more good thing with VSC is it is an open-source tool and has many features like syntax highlighting, bracket-matching, auto-indentation, box-selection etc.
5- Sublime Text
This is one more code editor used for the python development.
It has all the common features like Auto-Completion, selecting multi-line, Formatting, Syntax highlighting, etc
It has build in support to many packages which makes the sublime text editor very rich.
Sublime Text is not totally free, you can use the evaluation version as free but it has less features compared to the paid ones.
6- Atom
Atom is mainly used for developing many desktop applications using HTML,javascript, CSS etc. But you need to install an extension then only you can able to use Atom for python development.
It is a light weight tool and you can install it in many platforms. Only thing is compare to other editors it has less inbuilt features.
7- Thonny
Thonny is one IDE that you can use for the development of python.
It is mainly targeted for beginners for writing python programming.
It has features like Debugging, Highlighting syntax errors, Autocomplete, Variable scope highlighting feature etc
How to Uninstall Python 2.7
To Uninstall Python 2.7 from windows, follow these steps:
- Open Start– First click the windows logo in the bottom-left corner of the screen. A menu will appear.
- Open Setting– Click on the settings icon on the lower-left side of the start menu. It will open the settings windows.
- Click Apps– Click on the Apps.
- Find the version of python 2.7 which you want to uninstall– Scroll down until you reach apps with “python 2.7” name.
- Click on Python 2.7 version– Then expand it to display the Uninstall button.
- Click Uninstall– On version 2.7
- Click Yes when prompted– Click on yes and confirms that you want to uninstall python.
- Allow Python to Uninstall– A pop window with a progress bar appears, once the progress bar reaches the end, python should be uninstalled.
Python disable path length limit
In windows 10 latest update have a setting option for path length, follow these steps:
- First, go to the start menu and type “regedit”
- Then go to path “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
- After that double click on the long file path on the right side.
- A pop up will appear, in the long path enable type value data “1”.
- Now, this will allow the limit to pass.
- If you need to set the limit again set the value to “0” to disable the path length limit.
You may like following below Python Tutorials:
- How to concatenate strings in python
- What is Python and What is the main use of Python?
- How to use naming convention in python
- Why python is so popular? Why python is booming?
- How does python work? how python is interpreted?
- Create a list in Python
Conclusion
Python is the most popular open-source object-oriented programming language. Python is easy to learn and syntax wise it is very simple.
We can install python on different operating system like windows,Linux,Ubuntu,Mac,CentOS7 etc.
We learned about different IDE and code editors for the development of python like Pycharm, Spyder, Atom, Visual Studio, visual studio code, Sublime Text, Thonny etc
The latest python version on April 2020 is 3.8.2.
Python is the best!!!!!
This python tutorial explains the below points:
- how to install python on windows 10?
- How to install python on Linux?
- Install Python 3.6 on Ubuntu 16.10 and 17.04?
- How to install Python 3.8 on Ubuntu?
- Python 3 Installation on Mac.
- How to Install Python 3 on CentOS 7.
- Python IDEs and Code Editors
- How to Uninstall Python 2.7
- Python disable path length limit
I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.