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

前端 未结 10 869
迷失自我
迷失自我 2020-12-10 01:00

I am trying to install packages using pip and it is throwing error.

Command that I have used,

sudo pip install selenium

The error

10条回答
  •  借酒劲吻你
    2020-12-10 01:44

    I had the same problem on a shared hosting account which is very limiting (I was installing python and pip for my user only). Their lsb_release -a returns something non-standard and I cannot change it. I solved the issue by editing distro.py (in your case: /usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py) and changing the default parameter of __init__ method. In my version it was at the line 545. Snippet:

    def __init__(self,
        include_lsb=True,
        os_release_file='',
        distro_release_file=''):
    

    Just change include_lsb=True to include_lsb=False.

提交回复
热议问题