Set Up Python For ML
Background
You can use any computer language for learning, coding, and solving Machine Learning (ML) problems. The most common language to use is Python. The main reason for this is that there are many high quality libraries of ML algorithms already written and freely available for Python (e.g. PyTorch, TensorFlow, and Keras). This makes it really easy to get started and to try things out.
One main design feature of Python is that the core language is relatively small, and additional features are added through external packages. This can lead to problems since you can only install a single version of a package at a time.
The difficulty that can occur is that one package may depend on a specific version of another package, which can cause a conflict with some a third package. This problem is sometimes referred to as “dependency hell”.
The Python solution to this problem is to use a Python Virtual Environment. You can set up different virtual environments, and each virtual environment can have different packages and versions in it. This is quite handy and easy to do.

Installing Python and a Virtual Environment on a Linux Computer
In this section I will show how you can install Python and set up a virtual environment on a Ubuntu-based Linux computer. Run the following terminal commands one time to set it up.
sudo apt install python3 python3-pip python3-venv
python3 -m venv ~/Documents/MegaML_PythonThen run the following command to activate the python environment. You should repeat this command every time you start a new terminal window.
source ~/Documents/MegaML_Python/bin/activate
Installing Python and a Virtual Environment on a Windows
One of the easiest ways to install Python on a Windows computer is to download Python from: https://www.python.org/downloads/. Then run the same command to set up and activate the Virtual Environment as for Linux. That is it!
Jorgen Bergstrom