S
S
Sketch0072018-03-23 15:09:50
Python
Sketch007, 2018-03-23 15:09:50

How to convert .ui to .py using pyuic (PyQt5)?

There is an interface file testUI.ui. Pyqt5 and in the Python36-32\Lib\site-packages folder there is a uic folder
When trying to enter the console from the site-packages folder and from the uic folder (there is an interface file in both folders)
pyuic5 testUI -o testUI.py
Gives

C:\Users\Alexey\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\PyQt5\uic>pyuic5 testUI.ui -o testUI.py
""C:\Users\Alexey\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.6\python"" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

C:\Users\Alexey\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\PyQt5>pyuic5 testUI.ui -o testUI.py
""C:\Users\Alexey\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.6\python"" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

Also, I tried to directly enter the path to the pyuic.py file from the uic folder with the -help command
C:\Users\Alexey\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\PyQt5\uic\pyuic.py -help
Traceback (most recent call last):
  File "C:\Users\Alexey\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\PyQt5\uic\pyuic.py", line 28, in <module>
    from .driver import Driver
ModuleNotFoundError: No module named '__main__.driver'; '__main__' is not a package

In short, I've been struggling with this problem for 3 hours now. StackOverflow all tried, need your help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DarkMode, 2018-03-23
@DarkMode

https://stackoverflow.com/a/21524726/8442869

A
Alexander, 2018-05-04
@sanya84

python is not an internal or external
command, operable program, or batch file.

Your own paths, and the version of the interpreter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question