как исключить opengl32sw.dll из библиотеки pyqt5 при использовании pyinstaller? - PullRequest
0 голосов
/ 25 сентября 2019

Как написать правильный синтаксис для исключения opengl32sw.dll из pyqt5.

Я пытался использовать exclude в файле спецификации, но он не работает.

excludes=['cryptography','PyQt5/bin/opengl32sw.dll']

1 Ответ

0 голосов
/ 28 сентября 2019

Команда 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
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...