Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return Command 'lsb_release -a' returned non-zero exit status 1. #4924

Closed
WuJunde opened this issue Dec 15, 2017 · 15 comments
Closed

return Command 'lsb_release -a' returned non-zero exit status 1. #4924

WuJunde opened this issue Dec 15, 2017 · 15 comments
Labels
auto-locked Outdated issues that have been locked by automation kind: crash For situations where pip crashes

Comments

@WuJunde
Copy link

WuJunde commented Dec 15, 2017

  • Pip version: pip 9.0.1
  • Python version: python 3.6.3
  • Operating system: debian 9.3

Description:

when I'm installing pyssim using pip
pip is intalled and used under anaconda

What I've run:

pip install pyssim

Exception:
Traceback (most recent call last):
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/commands/install.py", line 272, in run
    with self._build_session(options) as session:
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/basecommand.py", line 72, in _build_session
    insecure_hosts=options.trusted_hosts,
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/download.py", line 329, in __init__
    self.headers["User-Agent"] = user_agent()
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/download.py", line 93, in user_agent
    from pip._vendor import distro
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 1050, in <module>
    _distro = LinuxDistribution()
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 594, in __init__
    if include_lsb else {}
  File "/home/wujunde/anaconda3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 931, in _get_lsb_release_info
    raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

@pradyunsg
Copy link
Member

Hi @WuJunde!

This has been fixed in the in-development version of pip. It's due to distro dropping support for python 2.6, much like pip will in it's next major release.

@pradyunsg pradyunsg added kind: crash For situations where pip crashes resolution: duplicate Duplicate of an existing issue/PR labels Dec 16, 2017
@WuJunde
Copy link
Author

WuJunde commented Dec 20, 2017

but my python is python3.6, is this error normal?

@pradyunsg
Copy link
Member

Ah. I misread. My bad.

@pfmoore
Copy link
Member

pfmoore commented Dec 20, 2017

If you run lsb_release -a at the command line, what is the output?

@WuJunde
Copy link
Author

WuJunde commented Dec 21, 2017

Thanks for @pfmoore, I fixed it.
The problem is all about lsb_release, nothing to do with pip
My python3.6 doesn't have lsb_release pack (don't know why)
I just change my ptyhon2.7 to run lsb_release
in /usr/bin/lsb_release
FROM:
#! /usr/bin/python3 -Es
TO:
#! /usr/bin/python2.7 -Es

@pradyunsg pradyunsg removed the resolution: duplicate Duplicate of an existing issue/PR label Dec 22, 2017
@ankitdhall
Copy link

Hello,
I also managed to get a similar error. I have Python2.7 and Python3 on my Ubuntu 16.04 but am unable to figure out why this error is popping when I try to use pip and ppa to add repositories. What could be the problem here and how could I resolve it. Here's the trace:

pip install -U pip
Exception: Traceback (most recent call last):
File "/home/ankit/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/ankit/.local/lib/python2.7/site-packages/pip/commands/install.py", line 272, in run
with self._build_session(options) as session:
File "/home/ankit/.local/lib/python2.7/site-packages/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/home/ankit/.local/lib/python2.7/site-packages/pip/download.py", line 329, in init
self.headers["User-Agent"] = user_agent()
File "/home/ankit/.local/lib/python2.7/site-packages/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/home/ankit/.local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 1050, in
_distro = LinuxDistribution()
File "/home/ankit/.local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 594, in init
if include_lsb else {}
File "/home/ankit/.local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1
Traceback (most recent call last):
File "/home/ankit/miniconda2/bin/pip", line 11, in
sys.exit(main())
File "/home/ankit/.local/lib/python2.7/site-packages/pip/init.py", line 248, in main
return command.main(cmd_args)
File "/home/ankit/.local/lib/python2.7/site-packages/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/home/ankit/.local/lib/python2.7/site-packages/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/home/ankit/.local/lib/python2.7/site-packages/pip/download.py", line 329, in init
self.headers["User-Agent"] = user_agent()
File "/home/ankit/.local/lib/python2.7/site-packages/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/home/ankit/.local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 1050, in
_distro = LinuxDistribution()
File "/home/ankit/.local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 594, in init
if include_lsb else {}
File "/home/ankit/.local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1

Thanks for your time.

@gabefair
Copy link

gabefair commented Apr 27, 2018

I'm also unable to use pip all of a sudden on Ubuntu 16.04

When I run lsb_release -a I get:

File "/usr/bin/lsb_release", line 64
    print("No LSB modules are available.", file=sys.stderr)
                                               ^
SyntaxError: invalid syntax

The first entry of my /usr/bin/lsb_release file:
#! /usr/bin/python2.7 -Es

There is a bunch of discussion about it on stack overflow

@pradyunsg
Copy link
Member

This is an Ubuntu issue. You can probably fix it by reinstalling lsb-core. Consider asking on Ubuntu support channels as to how to do that. :)

@DonghoonPark12
Copy link

DonghoonPark12 commented Jul 8, 2018

sudo rm /usr/bin/lsb_release

It resolved my problem.

@sirks
Copy link

sirks commented Nov 5, 2018

sudo mv /usr/bin/lsb_release /usr/bin/lsb_release_back
just to be on the safe side

@AlbertSaiS
Copy link

sudo rm /usr/bin/lsb_release

It resolved my problem.

it's right ,thanks ah.

@banjin
Copy link

banjin commented Jan 8, 2019

sudo rm /usr/bin/lsb_release

It resolved my problem.

thans very much

@xuejx7
Copy link

xuejx7 commented Feb 22, 2019

sudo rm /usr/bin/lsb_release

It resolved my problem.

thanks

@wu-yy
Copy link

wu-yy commented Apr 27, 2019

sudo rm /usr/bin/lsb_release

it also solves my problem, thanks

@lock
Copy link

lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation kind: crash For situations where pip crashes
Projects
None yet
Development

No branches or pull requests