Traceback (most recent call last): File "/usr/local/python3/bin/pyinstaller", line 8, in <module> sys.exit(_console_script_run()) File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/__main__.py", line 194, in _console_script_run run() File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/__main__.py", line 180, in run run_build(pyi_config, spec_file, **vars(args)) File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/__main__.py", line 61, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 1019, in main build(specfile, distpath, workpath, clean_build) File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 944, in build exec(code, spec_namespace) File "/root/test/2.spec", line 20, in <module> noarchive=False, File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 429, in __init__ self.__postinit__() File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/building/datastruct.py", line 184, in __postinit__ self.assemble() File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 764, in assemble self._check_python_library(self.binaries) File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 834, in _check_python_library python_lib = bindepend.get_python_library_path() File "/usr/local/python3/lib/python3.7/site-packages/PyInstaller/depend/bindepend.py", line 1018, in get_python_library_path raise IOError(msg) OSError: Python library not found: libpython3.7mu.so.1.0, libpython3.7.so.1.0, libpython3.7m.so, libpython3.7.so, libpython3.7m.so.1.0 This means your Python installation does not come with proper shared library files. This usually happens due to missing development package, or unsuitable build parameters of the Python installation. * On Debian/Ubuntu, you need to install Python development packages: * apt-get install python3-dev * apt-get install python-dev * If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).
时间: 2023-12-14 08:02:36 浏览: 256
linux 下 pip3 报错“ File “/usr/bin/pip3”, line 9, in from pip import mainImportError: canno”处理
5星 · 资源好评率100%
根据错误信息显示,你的Python安装缺少必要的共享库文件,因此PyInstaller无法正常工作。这通常是由于缺少开发包或Python安装的构建参数不合适所致。
你可以尝试以下解决方法:
1. 如果你使用的是Debian/Ubuntu系统,可以尝试安装Python的开发包,命令如下:
```
apt-get install python3-dev
apt-get install python-dev
```
2. 如果你自己构建了Python,可以使用`--enable-shared`重新进行构建(在macOS上使用`--enable-framework`)。
在尝试这些解决方法之前,请确保你具有适当的权限来安装软件包或重新构建Python。如果问题仍然存在,请检查你的Python安装是否完整并且没有其他问题。
希望这能帮助你解决问题!如果你有任何其他问题,请随时提问。
阅读全文