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
Exception: Qt plugin directory '*/test/venv/lib/site-packages/PySide6/plugins' does not exist! #7385
Comments
Does |
Nevermind, looks like characters/encoding issue after all. Similar problem arises if I put a venv in a path that contains characters from my local alphabet (
|
thank you,i have solved this problem.It is really caused by the encoding. |
PyInstaller shouldn't barf over unicode paths so I'll keep this open. |
True, but this particular problem seems to be coming from Qt itself: import importlib
import sys
modname = sys.argv[1]
QtCore = importlib.import_module(modname + ".QtCore")
# Display plugins' path
if modname in ("PyQt6", "PySide6"):
plugins_path = QtCore.QLibraryInfo.path(QtCore.QLibraryInfo.LibraryPath.PluginsPath)
else:
plugins_path = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.LibraryLocation.PluginsPath)
print(plugins_path)
# Display current working directory
print(QtCore.QFileInfo('.').absoluteFilePath())
|
I'll see if I can pinpoint where the mangling occurs in the Qt. But if the problem is there, we should probably try to work around it on our side:
|
Hmm, I see. Probably ought to report the |
Turns out the problem is not in the Qt per-se either, but rather in the PySide and PyQt bindings. Both bindings, upon being loaded, generate an embedded The problem is, they use local 8-bit encoding ( I've opened PYSIDE-2204 with PySide and sent an email to PyQt mailing list. But there's more to this story. While in Qt6 And while we can work around these path encoding issues while building the application (e.g., to avoid the error in the OP), the same problem also affects the run-time. I.e., if a frozen application is placed in a location that contains non-ASCII characters, the Qt plugins will likely fail to be discovered and loaded due to mangled path (for PySide2/PyQt5 on all OSes, for PySide6/PyQt6 on Windows). |
PYSIDE-2204 has been fixed, so the issue should be fixed in upcoming As mentioned in above comment, While we could work around the problem for build-time for earlier
So for consistency sake and to prevent further confusion regarding the behavior, it seems better to leave things as-is. |
Description of the issue
Context information (for bug reports)
Output of
pyinstaller --version
:5.7.0
Version of Python:
3.9.5
Platform:
Windows (CN)
How you installed Python:
python.org/downloads
Did you also try this on another platform? Does it work there?
yes ,i try to run in base ,it works.
try the latest development version, using the following command:
(https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and
Make sure everything is packaged correctly
--noupx
or setupx=False
in your .spec-file--debug
topyi-makespec
orpyinstaller
or useEXE(..., debug=1, ...)
in your .spec file.Stacktrace / full error message
Please also see https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs
for more about what would use to solve the issue.
The text was updated successfully, but these errors were encountered: