Python pyqt5 ui Generate .py File Error [How to Solve]

Anaconda has been configured several times before, and there are similar problems: record it here for later viewing.

 from PyQt5 import QtCore
ImportError: DLL load failed: the specified module cannot be found.

 

Traceback (most recent call last):
  File "D:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Anaconda3\lib\site-packages\PyQt5\uic\pyuic.py", line 26, in <module>
    from PyQt5 import QtCore
ImportError: DLL load failed: the specified module cannot be found.

The configuration is as follows:

The problem is that the module cannot be found, but pyqt itself can run. Then I looked at the installed library and found that pyqt is 5.92, not pyqt5. That’s why.

Uninstall pyqt first:

Or use PIP uninstall pyqt;

Then install pyqt5. Use pip to install here. Pycharm’s installation tool is not found.

Installation command:

pip install PyQt5

Run again, OK!

Read More: