Day: June 9, 2020

Removing python 2.7 from Ubuntu 20.04

As you know Python 2.7 is deprecated and shouldn’t be used after Jan 1 2020:

Yet Ubuntu 20.20 comes with “python” defined to python 2.7!

I faced many issues recently because “pip” wasn’t present and today while installing Espressif IDF 4.2 I got many errors because python 2.7 still used on Ubuntu:

$ set-target esp32
The following Python requirements are not satisfied:
To install the missing packages, please run "/home/alan/esp/esp-idf/"
Diagnostic information:
IDF_PYTHON_ENV_PATH: /home/alan/.espressif/python_env/idf4.2_py3.6_env
Python interpreter used: /home/alan/.espressif/python_env/idf4.2_py3.6_env/bin/python

I solved my issues removing python 2 and installing python3 as default:

$ sudo apt purge python2.7-minimal
$ sudo apt install python-is-python3

After doing it I got IDF installed correctly.