Skip to main content

Python language

If you are brand new to the Python programming language, you first need to have it properly installed on your computer. To run a Python program, you will need a Python interpreter. There are a few ways you can install Python in your computer:

NOTE:

Please complete the whole reading before installing anything, as some parts highlight older practices and do not reflect the current way to install Python.

Install from Python.org

If you try to install Python from the official page python.org, you are essentially just downloading an executable program that operates a Python interpreter and holds a large suite of useful tools and functions that you can utilize in your code. This is known as the Python standard library.

Python_dowload

For the example image, the page usually picks up on the operating system of the computer you are using. If you are looking for a different format or a specific release version, you can manually search for it in the Active Python releases.

The best way to install and use Pyhthon for any operating system is through Environments

What are Python releases?

Python is community-based and open-sourced, meaning it is free to use, and anyone can participate in improving, maintaining and releasing their own libraries. This adds great functionality to the language but also requires the periodic release of newer versions, which helps to add these newer features and fixes previous bugs.

Python2vs3

All Python versions are formatted as A.B.C:

  • A represents the first number and its the larger release.

Python as a programming language was developed (1980's) and released (1991) and after a few years of increased popularity, Python 2.0 was released in 2000.

The aim of Python 2.0 was to shift into a more transparent and community-backed development process. The last version of Python 2, released in 2010, was Python 2.7. The support for this version ended on January 1, 2020.

Again, because its popularity and the rise of Machine Learning/Deep Learning/Artificial Intelligence tools, Python gained popularity in its applicability in data science and other software domains, like web and game development, cybersecurity, and blockchain.

In 2008 Python 3 was released with a new syntax that drastically changed the language to address security issues and design flaws in previous versions.

  • B represents a minor release.

They add functionality in a backwards-compatible manner. When using Environments This is the most common thing you need to change depending on the project you are working on.

By managing Python versions and environments properly, you:

  • Avoid “it works on my machine, but not in others” problems
  • Keep projects organized and reproducible
  • Ensure compatibility with required libraries and frameworks

Example with Pytorch:

Python2vs3

Think of it like having separate “toolboxes” — each project gets its own box with the exact tools it needs, so nothing clashes.

  • The third C represents patches to fix bugs. For example, as of writing this, the current release of Python is 3.14.0.

For most projects, it’s not necessary to specify the exact patch version when setting up a project. But when is it important to specify this?

In the example for the Pythorch library, stating that you need the python version from 3.10 to 3.14 means that any of those versions should work correctly with pytorch. If you find a project that says >=3.10,<3.13 it means that you need to use a version from 3.10 but not newer than 3.13.

You’d only need to pin an exact patch version (e.g. python==3.10.4) in rare cases, such as:

  • A library you use only works correctly on a specific patch (due to a known bug in another).

  • You’re debugging a very specific environment issue or reproducing results exactly (for example, in scientific computing or production servers).

So, which Python version do I need?

It is best to check the Python version that has fewer issues with the libraries and packages that you know you are going to need.

Going back to the example from the Pythorch library, it specifies in the description that the python specifications are mainly to be compatible to the other main library that you need to operate Pytorch, which is Numpy. For many projects, you will have examples of specific versions of Python versions and libraries. For open source projects, this requirements are often outlined in a file called requirements.txt.

For this, we will work with environments, which are little containers that will help you keep your libraries and Python versions running as smoothly as possible. But first, let's help you install Python on your computer.

Things you might want some more information on: