Python

Python

Python is an interpreted, high-level, general-purpose programming language.

Many of the tools like Ansible, Google Cloud SDK and AWS CLI are developed with and depend on Python.

Setup on macOS

The macOS setup will automatically install Ansible and Python 3 using Homebrew.

To install Python and pyenv, run the setup script with the python and pyenv tags:

./setup -t python,pyenv

Setup on Linux

To install Python and pyenv, run the setup script with the python and pyenv tags:

./setup -t python,pyenv

Managing Python versions with pyenv

Both Linux and macOS configuration use the markosamuli.pyenv Ansible role for installing pyenv and the latest Python 2 and Python 3 versions.

After the setup is complete, you should see the following versions installed:

$ pyenv versions
  system
* 2.7.16 (set by /home/markosamuli/.pyenv/version)
* 3.7.3 (set by /home/markosamuli/.pyenv/version)

Python 3 vs. Python 2

The use of Python 3 is highly preferred over Python 2 as the core Open Source Python 2.7 version will not be maintained past January 2020.

References