python lsb_release not working in debian 9
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I cannot get lsb_release module to work in python 2.7 or 3 on debian 9. I haven't tried on debian 8 yet but I need it to work on both.
Here's what I tried:
import lsb_release
print(lsb_release.get_lsb_information())
it returned I don't get an import error, I don't know why it doesn't work. Also, when running a script via sudo with
user = os.environ['SUDO_USER']
I get a key error, SUDO_USER doesn't exist? What gives?
debian python
add a comment |Â
up vote
0
down vote
favorite
I cannot get lsb_release module to work in python 2.7 or 3 on debian 9. I haven't tried on debian 8 yet but I need it to work on both.
Here's what I tried:
import lsb_release
print(lsb_release.get_lsb_information())
it returned I don't get an import error, I don't know why it doesn't work. Also, when running a script via sudo with
user = os.environ['SUDO_USER']
I get a key error, SUDO_USER doesn't exist? What gives?
debian python
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I cannot get lsb_release module to work in python 2.7 or 3 on debian 9. I haven't tried on debian 8 yet but I need it to work on both.
Here's what I tried:
import lsb_release
print(lsb_release.get_lsb_information())
it returned I don't get an import error, I don't know why it doesn't work. Also, when running a script via sudo with
user = os.environ['SUDO_USER']
I get a key error, SUDO_USER doesn't exist? What gives?
debian python
I cannot get lsb_release module to work in python 2.7 or 3 on debian 9. I haven't tried on debian 8 yet but I need it to work on both.
Here's what I tried:
import lsb_release
print(lsb_release.get_lsb_information())
it returned I don't get an import error, I don't know why it doesn't work. Also, when running a script via sudo with
user = os.environ['SUDO_USER']
I get a key error, SUDO_USER doesn't exist? What gives?
debian python
asked Nov 20 '17 at 6:27
answerSeeker
3541413
3541413
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Please donâÂÂt ask multiple questions in one.
Regarding your first question, you should use get_distro_information()
instead. get_lsb_information()
is used internally to load overrides from /etc/lsb-release
; get_distro_information()
uses that, along with other methods in the class, to provide the appropriate information.
Regarding your second question, if SUDO_USER
really isnâÂÂt present in the environment exported by sudo
(run sudo env
to check), that probably means that your sudoers
configuration deletes the variable from the environment.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Please donâÂÂt ask multiple questions in one.
Regarding your first question, you should use get_distro_information()
instead. get_lsb_information()
is used internally to load overrides from /etc/lsb-release
; get_distro_information()
uses that, along with other methods in the class, to provide the appropriate information.
Regarding your second question, if SUDO_USER
really isnâÂÂt present in the environment exported by sudo
(run sudo env
to check), that probably means that your sudoers
configuration deletes the variable from the environment.
add a comment |Â
up vote
2
down vote
accepted
Please donâÂÂt ask multiple questions in one.
Regarding your first question, you should use get_distro_information()
instead. get_lsb_information()
is used internally to load overrides from /etc/lsb-release
; get_distro_information()
uses that, along with other methods in the class, to provide the appropriate information.
Regarding your second question, if SUDO_USER
really isnâÂÂt present in the environment exported by sudo
(run sudo env
to check), that probably means that your sudoers
configuration deletes the variable from the environment.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Please donâÂÂt ask multiple questions in one.
Regarding your first question, you should use get_distro_information()
instead. get_lsb_information()
is used internally to load overrides from /etc/lsb-release
; get_distro_information()
uses that, along with other methods in the class, to provide the appropriate information.
Regarding your second question, if SUDO_USER
really isnâÂÂt present in the environment exported by sudo
(run sudo env
to check), that probably means that your sudoers
configuration deletes the variable from the environment.
Please donâÂÂt ask multiple questions in one.
Regarding your first question, you should use get_distro_information()
instead. get_lsb_information()
is used internally to load overrides from /etc/lsb-release
; get_distro_information()
uses that, along with other methods in the class, to provide the appropriate information.
Regarding your second question, if SUDO_USER
really isnâÂÂt present in the environment exported by sudo
(run sudo env
to check), that probably means that your sudoers
configuration deletes the variable from the environment.
answered Nov 20 '17 at 9:12
Stephen Kitt
143k22312377
143k22312377
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405709%2fpython-lsb-release-not-working-in-debian-9%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password