pip is showing error ‘lsb_release -a’ returned non-zero exit status 1

Ahhh the classic lsb_release issue. I have battled this problem many times. The issue is that your default Python implementation is trying to use Python 3 but lsb_release requires Python 2. To fix this problem do the following:

  • Open /usr/bin/lsb_release (Make sure you use sudo or open as root!)
  • Edit the first line to be #! /usr/bin/python2.7
  • Save the file

now you can use pip again and everything should be fine.

UPDATE May 2019: Newer versions of Linux are shipping with Python3 by default. As noted in the comments here, you may just need to use a specific version of Python 3.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)