ImportError: No module named ‘lsb_release’ – Debian Linux – Solution

Symptoms:

Using a apt tools may result in a following error:

Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 28, in 
    import lsb_release
ImportError: No module named 'lsb_release'
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 28, in 
    import lsb_release
ImportError: No module named 'lsb_release'

Solution

The most likely cause of this error message can be in inappropriate python version in use. Your system my have multiple python versions installed. The solution is to use either update-alternatives to change to a default python version or implicitly overwrite /usr/bin/lsb_release script’s interprater eg.:

FROM:
#! /usr/bin/python -Es
TO:
#! /usr/bin/python2.7 -Es