It is already 2020 and if you are looking for a quick answer, learn Python 3 and skip to the installation section.
If you still want to know the reasons why I recommend Python 3, keep reading this section.
Python 2 has been around for 20 years. After this year (2020), it will become obsolete and will not be maintained anymore. This means the programming community is migrating all their existing projects to Python 3.
Because of this, if anyone is learning Python as a beginner, Python 3 is the way to go. At the time of this writing, Python 3.8.3 is the latest stable version and you may wish to start your Python journey from there.
Depending on your operating system and environment, you might already have Python 3 installed on your computer. However, there is a good chance of it being Python 2.7 as opposed to the latest version.
I’ve done my best to cover how to install Python 3 in the most common operating systems (including mobile systems) because of this.
Step 2: Under Stable Releases, find the latest version.
Step 3: Depending on your hardware, pick either executable installer for 32-bit version or 64-bit version
Windows x86-64 executable installer – 64-bit (Most likely, this will be your system)
Windows x86 executable installer – 32-bit
Note: Don’t worry if you pick the wrong one. You can always uninstall and reinstall the version of your choice later.
Step 4: Run the downloaded installer file
If you want, change your installation path. However, it’s recommended that you keep it as it is.
Click the checkbox ‘Add Python 3.x to PATH’ so you will be able to use Python directly from your command prompt.
Step 5: You are done. Confirm your installation by typing python into your command prompt.
Windows Subsystem for Linux (WSL)
The installation for this is no different than the Python 3 installation for Ubuntu. Please follow the instructions there in the next section.
Most Linux distributions are pre-equipped with Python already. However, it is highly unlikely that it will be the latest version. Type the python --version into your shell or terminal and check what the Python version is. If it gives you an error, try the following.
If the returned version is Python 2.7.x, you definitely want to upgrade your Python. However, even if it is 3.x.x, we still urge you to upgrade it to the latest stable release.
For most Linux distributions, Python’s latest release can be directly installed without having to build it. However, in this tutorial, we have suggested you to build Python from source for distributions that produced errors for binary installations.
If you are prompted with the installation of command line developer tools, install them as well since you cannot continue your Homebrew installation without them.
Once it is installed, follow the commands below.
Check if you have Python installed
brew info python
If the version is older, upgrade Python to its latest release
brew update && brew upgrade python
If you do not have Python installed, go ahead with the following instead.
brew install python
Once this finishes, Python’s latest release will be installed in your macOS.
iOS users do have many options to choose from. The following are a few of the most popular Python IDEs that can be installed on your Apple iPhone or iPad.
Pythonista 3 is a handy Python interpreter that supports lots of fully-fledged IDE features such as code completion, debugger, and 3rd party library support.
Python Box enables you to import Python modules and have them executed on the go. This also allows 3rd party library installation.
This is an IDE with multi-language support. Textastic is also integrated with lots of fully-fledged IDE features.
Kodex is another IDE with fully-fledged features with multi-language support. It supports Regex search, key-binding, and highlighting.
Android(Phones and Tablets)
Android users have even more options than iOS users to choose from. The following are a few of the community picked IDEs for Android.
Pyroid is an offline interpreter with Python 3.7 support. Pip is also available for Pyroid with 3rd party library support. Image processing and machine learning frameworks OpenCV and TensorFlow are even available in Pyroid.
Dcoder is a fully-fledged IDE with support for multiple languages. It also has a debugger and a syntax highlighter.
QPython is an IDE with the interpreter, SL4A, and QPYI.
This is a different experience that allows Android users to use Python in the installed apps. This also supports PyPI packages.
Online Python Interpreters
Going beyond the limitations of your device, there are many online Python interpreters to choose from. The following are a few popular interpreters.
Google Colab is a free service that can be used to execute Python codes. With Colab, you can make use of the hardware such as GPU for machine learning related applications.
Repl is an IDE with support for multiple languages.
Tutorials Point Python Interpreter
This is a very simple, yet a useful interpreter that can be used to test simple codes and snippets.
Python is a powerful language and you can use the same source code across different operating systems because of its PVM.
Python is gaining lots of traction and it can be used in many areas of computer science and even robotics. Python gets newer releases frequently but for beginners, it is always good to stick to a stable release.
The content in this article is expected to be valid through the years for a long time as all the tools that have been used here have been around for a long time with lots of community support.
We hope this article covered as many platforms as possible. Happy coding!