3

I created notepad.ui the file in Qt4 Designer and tried to create the notepadwindow.py file by means of a command

pyuic4.bat notepad.ui -o notepadwindow.py

As a result I got the following error

Traceback (most recent call):
  File "C:\Python27\Lib\site-packages\PyQt4\uic\pyuic.py" line 31, in <module>
    from PyQt4 import QtCore
Import Error: DLL load failed: %1 then something strange on a different encoding Win32. 
3
  • Can you include a translation for the russian / cyrillic error message please? Commented Nov 25, 2012 at 13:08
  • As a note, you can avoid converting it (and keep a much more maintainable codebase) by using a QUiLoader to load the .ui file dynamically. Commented Nov 25, 2012 at 13:19
  • 3
    I think you have a version mismatch. 32-bit Python vs 64-bit PyQt or vice versa. Commented Nov 25, 2012 at 14:33

9 Answers 9

2

This is how I do it:

pyuic4 -x name.ui -o name.py

of course, in cmd go to the directory where your notepad.ui file is. Good luck.

Sign up to request clarification or add additional context in comments.

Comments

1

Some installation issue i guess

pyuic4 notepad.ui > notepad.py

this works for me

1 Comment

Had to do pyuic5 notepad.ui > notepad.py for me to get it working
1

I experienced with the same error and was able to solve it.

Although I work on a 64-bit Windows, my python shell (2.7.11) and all extension packages are 32-bit and they work well. I faced with many errors because my PyQt4 that i downloaded was 64-bit. When i remove it and install 32-bit PyQt4 the problem is gone and now i am able to convert .ui files to .py

Maybe your problem is the same with me or visa versa, but the versions of both idle and PyQt should match, either 32 or 64-bit.

Comments

0

open cmd and go to the directory where the ui file is being saved and there you write the following command.

pyuic4 -w notepad.ui > notepadwindow.py

1 Comment

the answer has been edited. see the edited answer. it may help you
0

I had the same problem with PyQt5 64-bit edition. Removed and replaced with 32-bit edition, then entered at the command prompt: pyuic5 -x "input.ui" -o "output.py" Ran great.

Comments

0

I think there are at least two possible error conditions

1.ImportError: DLL load failed: The specified module could not be found.

then you have to check your PyQT version is comptible with your python. In other words, if you use python 3.3, then you can only use PyQT for python3.3 and python 3.3 will not work with PyQT for python3.4

This was the problem I met. I solved it with re-install it

2. Import Error: DLL load failed: %1 then something strange on a different encoding Win32.

then it would be a OS problem. If you use 32bit Python then you have to use 32bit PyQt, so do 64bit

Comments

0

This is what i usually do when converting:

  • move to .ui file location with : cd /d D:\yourdirectory
  • YourPyuicLocation -x inputname.ui -o outputname.py

example :

C:\Users\ceppy\AppData\Local\Programs\Python\Python35\Lib\site-packages\PyQt5\pyuic5.bat -x Test.ui -o Test.py

Comments

0

use same version of python and PyQt .It worked out for me in solving error ImportError: DLL load failed: The specified module could not be found.

Comments

0

For me, it had something to do with the path, maybe it was too long. I copied the .ui file to another folder and ran the command and it worked.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.