-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"unable to find Qt5Core.dll" that's really there in install folder #4293
Comments
Ok so I found the origin of the issue and a workaround. Moving manually the PyQt5Core.dll file into |
@Overdrivr PyQt |
That's not correct, CI build for 5.12.3 crashes with exactly this error. |
@Overdrivr Sure, I actually mean that. |
Ah yes sorry, misread your message. Ok so we know where to look around for changes. |
Hey! I'm getting this exact error too. I tried adding PyQt5/Qt/bin path, tried adding Qt5core.dll to added data and added binary also in pyinstaller. But still same error
|
Here is the new function def find_qt():
import os
path = os.environ['PATH']
dll_dir = os.path.dirname(__file__) + '\\Qt\\bin'
if os.path.isfile(dll_dir + '\\Qt5Core.dll'):
path = dll_dir + ';' + path
os.environ['PATH'] = path
else:
for dll_dir in path.split(';'):
if os.path.isfile(dll_dir + '\\Qt5Core.dll'):
break
else:
raise ImportError("unable to find Qt5Core.dll on PATH")
try:
os.add_dll_directory(dll_dir)
except AttributeError:
pass
find_qt()
del find_qt Where the nonexistence of The previous version: import os as _os
_path = _os.path.dirname(__file__) + '\\Qt\\bin;' + _os.environ['PATH']
_os.environ['PATH'] = _path In "manylinux" or "macosx", the file |
My PyQt objects import uniformly in a file ( Update environment variable # QtModules.py
import os
import sys
if hasattr(sys, 'frozen'):
os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH']
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtChart import *
... It's strange that My program log about environment: OS Type: Windows 10 [AMD64]
Python Version: 3.7.0(final)
Python Compiler: MSC v.1914 64 bit (AMD64)
Qt Version: 5.12.4
PyQt Version: 5.12.3 Needs to:
|
This allows us to properly use color emojis on Linux and we don't need to add libQt5MultimediaGstTools anymore. We include a workaround to make PyQt5 5.12.3 work with PyInstaller, otherwise it would fail to start saying it can't find QtCore.dll. See pyinstaller/pyinstaller#4293 We also remove an unneeded copy of the Qt binaries.
This allows us to properly use color emojis on Linux and we don't need to add libQt5MultimediaGstTools anymore. We include a workaround to make PyQt5 5.12.3 work with PyInstaller, otherwise it would fail to start saying it can't find QtCore.dll. See pyinstaller/pyinstaller#4293 We also remove an unneeded copy of the Qt binaries.
This allows us to properly use color emojis on Linux and we don't need to add libQt5MultimediaGstTools anymore. We include a workaround to make PyQt5 5.12.3 work with PyInstaller, otherwise it would fail to start saying it can't find QtCore.dll. See pyinstaller/pyinstaller#4293 We also remove an unneeded copy of the Qt binaries.
Found same issue for PyQt 5.13.0 (via pip) (Downgrading to 5.12.2 also fixed the problem) |
See pyinstaller/pyinstaller#4293 and gridsync/gridsync@0abf8e7 (cherry picked from commit e58aa9c)
Can confirm this worked for me also |
Thank u sooooo much, ur point really help me out |
Would anyone be willing to fix this for PyQt5 5.12.3? It's a bit annoying to have to use the manual workaround described above for every single deploy. |
@matthewgdv I don't know much about PyInstaller, just some ideas. The first step of modifying os.environ['PATH'] = sys._MEIPASS + os.pathsep + os.environ['PATH'] And does anyone know where the copy functions of |
If fixed, this will probably given in a new release i think. As this isn't version specific, as i said, 5.13.0 is also affected. I think all > 5.12.2 are. |
After applied the patch of I will test the version of PyQt 5.12.3 (Qt 5.12.4). Update: It seems that the Can you help me test if this patch is a generic solution? |
Still, have problem with or without patch |
@Duskhorizon What is the error message? |
Doesn't work for me either
|
Manually added the following to my spec file and it works after that.
Note this needs to be modified to the following for regular pyinstaller (non-developmental build):
|
This worked perfectly, thank you so so much!
(Address adjusted based on where PyQt5 ins installed) |
@sz2723 Thanks! It works for me. I've wrote it in this way for my project: from pathlib import Path
import os
import PyQt5
opts = [ ...
f"--add-data={Path(PyQt5.__file__).parent}/Qt/bin{os.pathsep}PyQt5/Qt/bin"
] |
This is fixed now as of 47bd7f1. |
Hello, I'm getting exactly the same error as: Just installed via PIP today on Windows. |
I upgraded my PyQt5 to 5.13.1 and it's fixed. e.g pip install PyQt5 -- upgrade |
This worked after excruciating debugging. |
At least I hope so... When I bumped PyQt5 to 5.15.4 I got this: ``` 15839 INFO: Appending 'datas' from .spec Unable to find "c:\python39\lib\site-packages\PyQt5\Qt\bin\*" when adding binary and data files. ``` The code I'm removing here it is from: pyinstaller/pyinstaller#4293 (comment) PyQt5 python packaging changed a lot between 5.15.2 and 5.15.3.
Hi folks,
I'm packaging another PyQt5 application, and facing an issue at launch time:
What's weird is that the PyQt5 DLL ARE in the install folder, see below:
I thought that the base directory of the EXE file would at least be in the PATH, yet pyinstaller's bootloader can't find this DLL. Any idea on how to debug this ?
I'm puzzled because I recently packaged a similar PyQt5 app without problem.
The text was updated successfully, but these errors were encountered: