Команда exclude
работает только для модулей Python, но не для библиотек DLL.Я думаю, что простой, но грязный способ здесь - создать virtualenv и вручную удалить ненужные библиотеки DLL.
Другой более сложный способ - найти файл хука PyQt
, расположенный в <Python_Path>\lib\site-packages\PyInstaller\utils\hooks\qt.py
, и отключить строку, которая связывает файл opengl32sw.dll
:
# Gather required Qt binaries, but only if all binaries in a group exist.
def get_qt_binaries(qt_library_info):
binaries = []
angle_files = ['libEGL.dll', 'libGLESv2.dll', 'd3dcompiler_??.dll']
binaries += find_all_or_none(angle_files, 3, qt_library_info)
# comment the following two lines to exclude the `opengl32sw.dll`
# opengl_software_renderer = ['opengl32sw.dll']
# binaries += find_all_or_none(opengl_software_renderer, 1, qt_library_info)
# Include ICU files, if they exist.
# See the "Deployment approach" section in ``PyInstaller/utils/hooks/qt.py``.
icu_files = ['icudt??.dll', 'icuin??.dll', 'icuuc??.dll']
binaries += find_all_or_none(icu_files, 3, qt_library_info)
return binaries