ImportError: No module named lsb_release
Ubuntu 14.04 has the lsb_release.py
file installed for Python 2.7 as well and lsb_release
seems to work under python2.7 as well. You can try this by doing:
python2.7 /usr/bin/lsb_release
If that works, make a backup of the file /usr/bin/lsb_release
and change the first line to read:
#! /usr/bin/python2.7
(you can experiment with the -Es
options, I would leave them out intially).
Once you can run apt-get
again, reinstall python3 and it dependencies. You can determine the direct dependencies by using apt-cache depends python3
and use apt-rdepends
or reverse-depends
(both have to be installed) to get dependencies recursively.
Note - Find Original Answer by Anthon on unix.stckexchange.com
Related videos on Youtube
user3752051
Updated on September 18, 2022Comments
-
user3752051 almost 2 years
When I run
lsb_release -a
, it shows an error:Traceback (most recent call last): File "/usr/bin/lsb_release", line 26, in <module> import lsb_release ImportError: No module named lsb_release
I have change default python version Python2.7 to python2.6. Ubuntu 12.04
how to solve this problem?
-
muru about 8 yearsAnd how did you make that change?
-
user3752051 about 8 yearsgoto this link web.mit.edu/6.00/www/handouts/pybuntu.html here is steps how to change default python version . i am using ubuntu 12.04
-
Gunnar Hjalmarsson about 8 yearsPossibly you run into this (pretty old) bug.
-
-
user3752051 about 8 yearsi need same solution for python2.6 i am using Ubuntu 12.04
-
TamaMcGlinn about 4 yearsThis difference occurs between python 3.5 and python 3.6. You can confirm that by doing just
python3.5 -c 'import lsb_release'
and similar for python3.6