1

When I try to convert a ui file to py using this command:

pyuic4 -o test.ui test.py

it gives this error:

screenshot

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Itay Katsnelson
  • 69
  • 1
  • 2
  • 8
  • There must be a conflict with your python and pyqt system installation. For example, you installed a Python 3.4 (x64) and installed the PyQt (x86) or vice versa. Can you give more details about the version you are using ? – syedelec Feb 13 '17 at 17:08
  • how can i show u the version ? – Itay Katsnelson Feb 13 '17 at 17:56
  • open `cmd.exe` write `python` then `import platform` then `platform.platform()` and copy the output. Also how did you install PyQt ? did you use binaries or pip ? – syedelec Feb 13 '17 at 18:07
  • 'Windows-8-6.2.9200' heres the platform also i installed it from a exe that i found – Itay Katsnelson Feb 13 '17 at 18:11
  • we will continue in a chat : http://chat.stackoverflow.com/rooms/135620/pyqt4-error-with-transferring-to-python-file-from-ui – syedelec Feb 13 '17 at 18:12
  • i cant i must have 20 rep to talk there :/ – Itay Katsnelson Feb 13 '17 at 19:26
  • what you can do is go to Install Uninstall programs in Widows and read the version of Python if it is (x64) or (x86), do the same with PyQt. – syedelec Feb 13 '17 at 19:33
  • so i downloaded the python here : https://www.python.org/downloads/release/python-340/ and i downloaded the MSI x86 ... and the pyqt is x64 from what i remember ... that can cause the problem ? – Itay Katsnelson Feb 13 '17 at 19:36
  • yes this is the problem, you have to match the python installed version which is x86 in your case. So uninstall pyqt x64 and install the pyqt binaries x86. This should work. – syedelec Feb 13 '17 at 21:11
  • i cant find a x86 pyqt download and the python is only x86... do u know how can i download a x64 python ? – Itay Katsnelson Feb 14 '17 at 06:03
  • here is a link to pyqt4 x86 for python 3.4 x86 : https://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py3.4-Qt5.5.0-x32.exe/download – syedelec Feb 14 '17 at 07:27
  • YOU ARE A GOD!!!!! thanks so much for helping me dude... i didnt know x86 is 32 bit ... so weird... why would they do that ? anyway thanks for taking your time and helping me .:) do u have a guide on how to work with the designer ? – Itay Katsnelson Feb 14 '17 at 07:47
  • No I am not :) but I am glad it helped. I don't work with the designer sorry, I write most of my UI with code. I will make an answer so it can help other users. – syedelec Feb 14 '17 at 17:01

1 Answers1

0

This error is frequent and basically it says that to have Python and PyQt working correctly, system versions need to match.

e.g: if you have Python 3.4 (x86) you will need PyQt (x86)

Windows binaries for PyQt4/PyQt5 x86/x64 can be found in the SourceForge repository : https://sourceforge.net/projects/pyqt/files/

syedelec
  • 1,285
  • 2
  • 19
  • 30