1

I'm stuck at the very first step of converting the .ui file created with QT Designer into a .py file.

System details (all programs in PATH):

  • Windows 8
  • Python 3.4.3-x32
  • Qt 5.4.1 x32
  • PyQT 5.4.1-Py3.4-Qt5.4.1-x32
  • PYTHONPATH is C:\python34

In a terminal window, from the directory containing the .ui file I run this command:

pyuic5 -x mainform.ui -o mainform.py

This raises the error:

C:\python34\python.exe: Error while finding spec for 'PyQt5.uic.pyuic' (: No module named 'PyQt.uic.port_v3')

I tried to uninstall and reinstall python, Qt and PyQt (in this order), but the error persists.

As a workaround I'm using PySide but, since the PySide project seems frozen in the last two years and doesn't support Qt 5 I'd switch to PyQt5.

icedtrees
  • 6,134
  • 5
  • 25
  • 35
zandar
  • 11
  • 3
  • Did you use the Binary or source package to install? Also, what does the command pyuic5 output when you just type it into the terminal? – ham-sandwich Apr 26 '15 at 14:28
  • I used the binary. The output of the pyuic5 command in a terminal window is: **Error while finding spec for 'PyQt5.uic.pyuic' (: No module named 'PyQt5.uic.port_v3')** – zandar Apr 26 '15 at 19:00

1 Answers1

0

I think PYTHONPATH is the where the site-packages located. In your case, under Windows it should be C:\Python34\Lib\site-packages instead of C:\Python34, I guess ? That might be the reason why python cannot find the package.

I have similar error when upgrade PyQt5 (for Qt5.4) under Debian/testing recently. pyqt5-dev-tools for python2 which containing pyuic5 has disappeared and pyuic5 is only available for python3-pyqt5. After I installed python3 and pyqt5, I forgot to export site-packages for python3, I got this error. The problem has been solved by adding the python3 site-packages to PYTHONPATH.

ptee
  • 53
  • 5