Tag Archives: ubuntu1.8

Ubuntu1.8 Install python3.7pip Error: “subprocess.CalledProcessError…lsb_release”

background

Install Python 3.7 on a Ubuntu 18.04. After that, try the PIP list command, and a long list of errors appear. I’ll post the last few lines:

File “/usr/local/lib/python3.7/subprocess.py”, line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.

When executing the PIP list command, the LSB cannot be found_Release – a this command
solutions

1. LSB found_Release.py this file

sudo find/-name ‘lsb_release.py’

The results shown here are as follows. There may be differences between different system versions:

/usr/share/pyshared/lsb_release.py
/usr/lib/python2.7/dist-packages/lsb_release.py
/usr/lib/python3/dist-packages/lsb_release.py

2. Select the path containing python3 and copy the file to the error path/usr/local/lib/python3.7/

sudo cp /usr/lib/python3/dist-packages/lsb_release.py/usr/local/lib/python3.7/

Try to execute PIP list again and return to normal.