1

I have a UI designed with QT Creator, and I want to import it to Python. I have installed Anaconda 2 and I've checked that the package PyQt5 is installed. When I run the command to convert the .ui file to a .py file

D:\> python "C:\Program Files\Anaconda2\Lib\site-packages\PyQt5\uic\pyuic.py" D:\mainwindow.ui -o D:\MainWindow.py

the following error shows

Traceback (most recent call last):
File "C:\Program Files\Anaconda2\Lib\site-packages\PyQt5\uic\pyuic.py", line 28, in <module>
from .driver import Driver
ValueError: Attempted relative import in non-package

Can anyone tell me why that error is happening and how can I convert the .ui file to a .py file?

Thanks in advance!

a.ras2002
  • 385
  • 2
  • 7
  • 21
  • Read this: http://stackoverflow.com/questions/11536764/how-to-fix-attempted-relative-import-in-non-package-even-with-init-py – Mohammad Yusuf Dec 31 '16 at 17:08
  • Sorry but that doesn't help me because I can't chage the pyuic.py, as far as I understand that file is OK and should work properly... – a.ras2002 Dec 31 '16 at 17:12

0 Answers0