Just made a Python program to calculate body mass index BMI, and used Pyside6 to draw the user interface. When using auto-py-exe ( auto-py-to-exe is based on pyinstaller, compared to pyinstaller, it has more GUI interface, which makes it easier to use. for simplicity). After packaging, click main.exe, but it prompts an error: RuntimeError: Unable to open/read ui device. Repeated debugging does not know where the problem is.
At first, I thought there was a problem with the loading UI statement in the main program (main.py). I repeatedly modified the main program, and finally found that it was not the problem of the program.
class Stats(): def __init__(self): # loading UI file self.ui = QUiLoader().load(".\\cac_BMI.ui")
Finally, I found that I needed to put the UI file into the packaged executable folder.
Put the UI file and the main program in the same folder, which is convenient for the main program to call.
Then double-click main.exe, has been able to successfully open the program user interface, and the problem has been successfully solved.
- Pyinstaller Error: [ImportError]: DLL load failed while importing _socket: Parameter error
- [Solved] SystemError: Parent module ” not loaded, cannot perform relative import
- [Solved] Pyinstaller package opencv error: ImportError: OpenCV loader: missing configuration file: [‘config.py’]. Check OpenCV installation.
- [Solved] Pyinstaller Error: “RuntimeError: No metadata path found for distribution ‘greenlet‘
- [Solved] Pyinstaller packaged exe error: “failed to execute script XXX”
- pytorch RuntimeError: Error(s) in loading state_ Dict for dataparall… Import model error solution
- How to Solve PyInstaller Package Error: ModuleNotFoundError: No module named ‘xxxx‘
- [Solved] RuntimeError An attempt has been made to start a new process
- [How to Solve] pyinstaller failed to execute script
- Python Use PIP to install pyinstaller Error [Solved]
- Pyinstaller Error: INTEL MKL ERROR: The specified module could not be found. mkl_intel_thread.1.dll.Intel MKL FATAL ERROR: Cannot
- [Solved] Python Project Import Module Error: ModuleNotFoundError
- The solution of no such file or directory and cannot load native module running error of python3 pyinstaller after packaging
- Python2.7 Pyinstaller Install Error: ERROR: Command errored out with exit status 1
- [Solved] error: unrecognized arguments: –multiprocessing-fork
- A summary of a demo development process for Python using the QT5 development interface
- Python Error: OSError: cannot open resource [How to Solve]
- [Solved] Pygame.error: mixer not initialized & pygame.error: WASAPI can‘t find requested audio endpoint: Could not Find the Element.
- [Solved] Failed to obtain/convert traceback after Python Tkinter packages exe
- [Solved] RuntimeError: No application found. Either work inside a view function or push an application contex