pip install 报错Command 'lsb_release -a' returned non-zero exit status 1

用python,这环境问题真是够让人头痛的,在django用mysql数据库,pip安装mysqlclient时,出现以下报错:
Command 'lsb_release -a' returned non-zero exit status 1

解决办法:

看看/usr/lib/python3/dist-packages里有没有lsb_release.py
copy到你的python3(我的版本3.7,你看自己的是哪个版本):
$ sudo cp /usr/lib/python3/dist-packages/lsb_release.py /usr/local/lib/python3.7/

PS: pip安装mysqlclient方法:

https://pypi.org/project/mysqlclient/

你可能感兴趣的:(pip install 报错Command 'lsb_release -a' returned non-zero exit status 1)