Ubuntu系统中没有python3.8,安装完之后将pip3软连接到pip3.8后,执行pip3 list报错,原环境上安装的是python3.6。
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.
找不到lsb_release模块
1.在报错中可以知道报错是在 /usr/local/python3.8/lib/python3.8/subprocess.py,执行如下命令
sudo find / -name ‘lsb_release.py’
结果如下
/usr/lib/python2.7/dist-packages/lsb_release.py
/usr/lib/python3/dist-packages/lsb_release.py
/usr/share/pyshared/lsb_release.py
2.进到/usr/local/python3.8/lib/python3.8目录下,执行如下命令
sudo cp /usr/share/pyshared/lsb_release.py .
同时还需要将CommandNotFound所在的目录复制到上面相同的目录下面
sudo cp -fr /usr/lib/python3/dist-packages/CommandNotFound .
3.执行如下命令,将查找出来的带有36的文件都改成38
locate CommandNotFound
4.然后再次执行pip3 list就发现不报错啦!!!
参考博文:https://blog.csdn.net/tao_627/article/details/90901563