The following error appears when pyside2 is running:
error content: this application failed to start because not Qt platform plugin could be initialized.reinstalling the application may fix this problem.
Solution one: this method once and for all.
Add the plugins/platforms in the path of pyside2 to the user variables in the system environment variables. My path is as follows:
the specific operation is as follows:
variable name: QT_ QPA_ PLATFORM_ PLUGIN_ Path
variable value: D:: (soft) Anaconda (LIB) site packages (pyside2) plugins (platforms)
different users have the same variable name, and the variable value varies with the file location
finally, after saving the variables, be sure to restart the computer, because the new environment variables will not be recognized by the system until they are restarted!
**
Solution 2:
**
add the following code in the initial part of the program:
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
Code means to use temporary system environment variables, similar to solution one.
Similar Posts:
- Anki cannot start on Debian Buster [How to Solve]
- This application failed to start because no Qt platform plugin could be initialized
- Failed to install node with. MSI, rolling back action (Reprint)
- SDK manager cannot open the solution (Android)
- How to Solve MySQL Secure file priv error
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1
- When executing the vacuum SSH command, ‘SSH’ executable not found in any directions in the% path%. Solution to the prompt
- [Solved] Python import _ SSL DLL load fail error the module problem could not be found
- [Solved] MAVEN-COMPILER-PLUGIN Compile Error: FATAL ERROR: UNABLE TO FIND PACKAGE JAVA.LANG IN CLASSPATH OR BOOTCLASSPATH
- Android Studio Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT (Solved)