K
K
Kirakami612017-05-07 18:48:12
Python
Kirakami61, 2017-05-07 18:48:12

How to interpret .ui in .py?

I start learning pyqt, read various articles, watch video tutorials, everywhere the algorithm of actions is about the same. I made a layout in qt desinger, saved it to a 1.ui file, now to convert it to .py, I write to the console:
python C:\Users\Sergey\AppData\Local\Programs\Python\Python36-32\Lib\site -packages\PyQt5\u
ic\pyuic.py 1.ui -o 1.py I execute
and gives me an error:
File "C:\Users\Sergei\AppData\Local\Programs\Python\Python36-32\Lib\site- packages\PyQt5\u
ic\pyuic.py", line 28, in
from .driver import Driver
ModuleNotFoundError: No module named '__main__.driver'; '__main__' is not a package
I did not find solutions on the Internet, there were similar problems, but their solutions did not suit me. What is this mistake? How to get rid of it to convert .ui to .py?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex F, 2017-05-08
@Kirakami61

python3.6 -m PyQt5.uic.pyuic converter.ui -o converter.py  -x

"-X"

N
NaName, 2017-05-07
@NaName

It says that the import is wrong. It is necessary to correct the path\name of the Driver module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question