我是靠谱客的博主 震动含羞草,这篇文章主要介绍pyinstallers生成exe文件打开时报错:ImportError: unable to find Qt5Core.dll on PATH,现在分享给大家,希望可以做个参考。
复制代码
1ImportError: unable to find Qt5Core.dll on PATH
当前文件夹下新建这个py文件
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20# Fix qt import error # Include this file before import PyQt5 import os import sys import logging def _append_run_path(): if getattr(sys, 'frozen', False): pathlist = [] # If the application is run as a bundle, the pyInstaller bootloader # extends the sys module by a flag frozen=True and sets the app # path into variable _MEIPASS'. pathlist.append(sys._MEIPASS) # the application exe path _main_app_path = os.path.dirname(sys.executable) pathlist.append(_main_app_path) # append to system path enviroment os.environ["PATH"] += os.pathsep + os.pathsep.join(pathlist) logging.error("current PATH: %s", os.environ['PATH']) _append_run_path()
然后导入到你当前的py文件中
复制代码
1import fix_qt_import_error
再运行
复制代码
1pyinstaller -F xxx.py
问题2:
pyinstallers生成exe文件打开时报错:no module named 'pkg_resources.py2_warn'
最后
以上就是震动含羞草最近收集整理的关于pyinstallers生成exe文件打开时报错:ImportError: unable to find Qt5Core.dll on PATH的全部内容,更多相关pyinstallers生成exe文件打开时报错:ImportError:内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复