Hey buddy ๐, welcome to my little world. Today, we shall learn how to install Python without getting errors and Python not being recognised.
If you are a novice in programming languages and would love to start with Python, I want to congratulate you and welcome you to the Pythonistas Community.
You probably chose Python because of its simplicity and friendliness. You could have another reason.
Python Versions:
Python has various versions available with differences between the syntax and working of different versions of the language. We need to choose the version which we want to use or need.
There are different versions of Python 2 and Python 3 available. Python 2 reached its end of life last year.
Steps Of Installation:
Windows
:
๐ Head over to python.org
๐ Go to the Downloads
section
๐ Click on Python 3.10.0 for the latest and the installer will download
๐ Alternatively you can select the version of Python to install from the list here but I would recommend the latest because of bug fixes, support and security.
๐ I am assuming a 64-bit machine, If you are not sure.
First, find out if you have 64 bit or 32 here
๐ If it is 32-bit, check out the installer here
๐ Run executable installer after downloading. You need admin rights for this
Follow the steps and kindly check the Add Python To Path
In case you forgot to check the add path option.
๐ธ In the search bar, type edit environment variables
๐ธ Find the path where it is installed and usually it is C:/users/yourname/programs
๐ธ If you changed the directory, simply head over to that path because our point is to locate the python.exe installer.
๐ธ Click on Path, edit add
๐ธ Add new If it does not exist
๐ธ Copy and paste the path of python as the value name and PATH as the variable name.
๐ธ Save or Add or Ok
๐ธ Restart all terminals.
Alternatively, You can use the where
command in the terminal to locate the path.
Adding Python to PATH makes it possible for you to run (use) Python from your command prompt (also known as command-line or cmd).
Optional Features
The offline installer includes the components necessary for a default installation and only requires an internet connection for optional features. Though this will take more time. You can check all
The above features include Tkinter, a standard Python GUI and Official Docs that you will need offline.
To Check For Python Version
๐ Simply open the terminal or search cmd and type
๐ Type python --version
๐ To Enter into terminal, run python
or py
If you get any errors, please make sure that you have followed the above steps promptly.
Mac
:
Mac OS usually comes with Python 2 installed but that version is deprecated and is no longer supported.
As far as I know, you should not tamper or mess with that version since the OS also uses it.
Now, head over to ether of these two articles:
๐น The HitchHikers Guide
๐น Free Code Camp Article
Read More About Python 3.10 Features From Real Python :
Other Platforms
:
Ubuntu and other versions of Debian Linux ship with Python 3 pre-installed. You just need to update them.
To Install on others read more here.
Conclusion
Congs ๐ If you successfully installed Python without errors.
Now go read the official docs about the language for more.
Please consider subscribing for related content.
Happy Learning ๐ Happy Coding ๐
Ronnie Atuhaire ๐ค