How to fix “ImportError: unable to find Qt5Core.dll on PATH” after pyinstaller bundled the python application

后端 未结 5 977
滥情空心
滥情空心 2021-01-05 06:01

Can\'t run QT based GUI application bundled by pyinstaller, the console output shows it is due to an import error:

ImportError: unable to find

5条回答
  •  滥情空心
    2021-01-05 06:07

    I solved this for myself by commenting all in site-packages\PyQt5\__init__.py and adding this code from an older version of QT __init__.py:

    import os as _os
    
    _path = _os.path.dirname(__file__) + '\\Qt\\bin;' + _os.environ['PATH']
    _os.environ['PATH'] = _path
    

提交回复
热议问题