1

I have downloaded python 3.6.2 from python.org and pyqt 5.9.2 using pip to install but I am having a problem when converting code from .ui to .py

C:\Users\pc\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pyqt5-tools>pyuic5 -x satesto.ui -o satesto.py
Traceback (most recent call last):
  File "c:\users\pc\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\pc\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\pc\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\pyqt5-tools\pyuic5.exe\__main__.py", line 5, in <module>
  File "c:\users\pc\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\uic\pyuic.py", line 26, in <module>
    from PyQt5 import QtCore
ImportError: DLL load failed: The specified procedure could not be found.

It says that dll load is failed when typing from PyQt5 import QtCore but when I type it in basic python it works without a problem. Do anyone know what could be the problem or how can it be solved?

thewaywewere
  • 8,128
  • 11
  • 41
  • 46
irakli
  • 51
  • 2
  • 7

2 Answers2

2

You can follow these steps(Windows 8 or 10 User) to accomplish the converting from .ui to .py

  1. Open the folder Python36\Scripts

  2. Click shift key anywhere in the window and then select PowerShell

  3. Write pyuic5 -x the place where you have saved ui data -o name.py

    example: pyuic5 -x C:\User\Documents\MyPython\MyGui.ui -o MyGui.py

  4. You will find MyGui.py in Scripts of the Python36

Community
  • 1
  • 1
Ahmad
  • 227
  • 3
  • 15
  • 1
    same error as with other ways I found that should solve the problem - no module named 'PyQt5.sip' – juerg Sep 16 '18 at 09:11
1

I had a very similar problem, on windows 10 x64 and Python3.5. I could fix it by simply installing an older version, namely Pyqt5-5.9.

You need to uninstall Pyqt5, pyqt5-sip and pyqt5-tools and then re-install pyqt5-5.9. The following code can do the job:

pip uninstall pyqt5
pip uninstall pyqt5-sip
pip uninstall pyqt5-tools

and the the installation:

pip install pyqt5 == 5.9

pip install pyqt5-tools

A.J.
  • 31
  • 7