在用pyinstall打包包含PyQt的程序时遇到了ImportError: DLL load failed while importing QtCore
代码运行的时候没有问题,可以正常运行,但是打包完会出现QtCore调用失败的问题。
import sys
import os
if hasattr(sys, 'frozen'):
os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH']
from PyQt5 import QtCore, QtGui, QtWidgets
torchvision\io\image.py:13: UserWarning: Failed to load image Python extension:
torch\_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000023157AFC3A0>.
warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torch\_jit_internal.py:751: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000023157AFC5E0>.
warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
Traceback (most recent call last):
File "GUIStapleDetect.py", line 25, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "StapleDetect.py", line 13, in <module>
ImportError: DLL load failed while importing QtCore: The specified procedure could not be found.
[25576] Failed to execute script 'GUIStapleDetect' due to unhandled exception!
您好,请问您解决了吗?如果解决了的话方便告知一下解决方法吗,非常感谢
代码打包发来我试试,你这也发个这谁能知道