Ubuntu pyinstaller Error when packaging the executable: … qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “…
Solution to the problem
Problem
Ubuntu pyinstaller reports an error when packaging the executable: .QFactoryLoader::QFactoryLoader() checking directory path “/home/dyj/CarUI/dist/carmain/platforms” … qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “” This application failed to start because no Qt platform plugin could be initialized.
Solution
Add the following code to your own main program code.
import os
import PySide2
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
Read More:
- Ionic Save to Gallery Plugin IOS Error: Method ‘requestAuthorization:’ not defined in Plugin ‘PhotoLibrary’ ERROR: Method ‘xxx’ not defined
- Failed to find Qt component “Widgets“ [How to Solve]
- [Solved] ubuntu makefile Cross-compilation error: file not recognized: file format not recognized
- [Solved] Ubuntu Open jpg Image Error: Error interpreting JPEG image file (Not a JPEG file: starts with 0x89 0x50)
- Ubuntu20.04 install the ROS noetic version in catkin_Problems in make compilation
- Solved: could not find the task ‘G + + build active file, leetcode algorithm ACM compilation and debugging
- Linux Ubuntu ImportError: Libtk8.5.so: cannot open shared object file:No such file Install tkinter Library
- Fastplanner compilation error: Could not find a package configuration file provided by “cmake_modules”
- Error: linker ` link. Exe ` not found | = note: the system cannot find the specified file.
- [Solved] Cannot run program “svn” (in directory “D: xxxx”): CreateProcess error=2, the system cannot find the specified file.
- [Solved] /usr/bin/ld: cannot find crti.o: No such file or directory & /usr/bin/ld: cannot find -lc
- [Solved] ubuntu Run jupyter Error: print(‘Error in generated code:‘, file=sys.stderr) SyntaxError: invalid syntax
- [Solved] Ubuntu Compile AOSP Error: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
- How to Solve Mujoco Install Error in Ubuntu (Pycharm Run Error)
- The upgrade of Ubuntu results in an error in the compilation of Android Jack [Two Method to Solve]
- [Soled] MTPuTTY error: unable to run putty the system cannot find the specified file
- When installing software in Ubuntu, it prompts: E: You don’t have enough free space in /var/cache/apt/archives/.
- [Solved] Ubuntu Update source error: Certificate verification failed: The certificate is NOT trusted.
- NXP mx8 Platform tensorflow-lite build error [How to Solve]
- Ubuntu Run Error: not syncing : VFS: Unable to mount root