1.ubuntu之前安装python3.5版本,更新升级为python3.7版本。
2.使用pip3 install pyinstaller,报subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
3.执行sudo find / -name 'lsb_release.py'
4.将相关文件进行copy
sudo cp /usr/share/pyshared/lsb_release.py /usr/local/python3/lib/python3.9/
5.执行sudo locate CommandNotFound
6.将上面的35修改为37
sudo mv /usr/lib/python3/dist-packages/CommandNotFound/__pycache__/CommandNotFound.cpython-35.pyc /usr/lib/python3/dist-packages/CommandNotFound/__pycache__/CommandNotFound.cpython-37.pyc
sudo mv /usr/lib/python3/dist-packages/CommandNotFound/__pycache__/__init__.cpython-35.pyc /usr/lib/python3/dist-packages/CommandNotFound/__pycache__/__init__.cpython-37.pyc
sudo mv /usr/lib/python3/dist-packages/CommandNotFound/__pycache__/util.cpython-35.pyc /usr/lib/python3/dist-packages/CommandNotFound/__pycache__/util.cpython-37.pyc
7.再次执行sudo pip3 install pyinstaller 成功