0 Index1 Preparation2 Install3 Input4 Run5 What6 Discussion7 Play8 Share9 Presentation


Python is a programming language widely used in the field of machine learning. It can be run from the Terminal in order to execute scripts and programs. There is also a small Python introduction from a previous H&D Event.

Currently, two non compatible versions of Python exist, the discontinued version 2.7 and the current version of 3.7. To use Tensorflow, we will need at least version 3.3, but not higher than 3.6!

To continue with the following steps, please open your Terminal window.

Which version do I have?

$ python -V

If that returns something in between 3.3 and 3.6, everything is good and you don’t need to continue reading this page.

However it is possible, that it returns 2.x even if you have the disired version installed. To be sure, type

$ python3 -V

Downgrading from 3.7 to 3.6

You will first have to uninstall any version higher than 3.6.x. If you installed Python from the installer package (I’m sorry!), find Python 3.x in your applications folder, move it to the trash and then carefully type

$ sudo rm -rf /Applications/Python\ {version.number}/

If you can’t find Python in your application folder, see this thread kindly ask James to help you (sorry James!).

Installing Python3 on a Mac

You find the (now correct) installer on the USB drive or download it from the official website. Confirm by checking for the version agein. If everything is fine, you might want to continue with installing Tensorflow.

Changing alias

Type if you want the command python to interpret python3 instead of some old version, please type

$ alias python=python3

However, the effect of this action might not last forever and be undone soon for some reason.