Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is pyside-uic?

Tags:

python

qt

pyside

I'm trying to use Qt Designer and pyside-uic mydesign.ui > design.py

however, this program doesn't exist. I looked in site packages under python 2.7, and I see: pyside-lupdate.exe pyside-rcc.exe

and a bunch of other programs, but there is no such thing as pyside-uic.exe ... why ?? Why is it missing from the installation package? Where do I get it?

like image 575
Dexter Avatar asked Jul 13 '11 19:07

Dexter


People also ask

Where is PySide2 UIC EXE?

Like designer.exe, pyside-uic.exe, pyside2-uic.exe can also be found in the installation directory of python or Maya. Tips: cmd path cd is the development path (. ui,. py file path), drag pyside-uic.exe to the cmd window.

What is PySide package?

PySide is a Python binding of the cross-platform GUI toolkit Qt developed by The Qt Company, as part of the Qt for Python project. It is one of the alternatives to the standard library package Tkinter. Like Qt, PySide is free software. PySide supports Linux/X11, macOS, and Microsoft Windows. PySide.

What is PySide2?

PySide2 is the official Python module from the Qt for Python project, which provides access to the complete Qt 5.12+ framework. The Qt for Python project is developed in the open, with all facilities you'd expect from any modern OSS project such as all code in a git repository and an open design process.


5 Answers

If you installed PySide with homebrew, you need to install pyside-tools package also to get these command line tools:

$ brew install pyside-tools
like image 175
kissgyorgy Avatar answered Oct 02 '22 05:10

kissgyorgy


You should see a /Python27/Scripts/pyside-uic.exe. But I'm wondering why it's not visible (not executable). Maybe it's a packaging problem (permissions, etc). You could try to call it using the complete path.

like image 25
Luck Avatar answered Oct 04 '22 05:10

Luck


When I installed using conda, the py-uic.exe was not unpacked. The problem was fixed by uninstalling and using pip.

>pip install pyside
like image 29
Mitch Avatar answered Oct 03 '22 05:10

Mitch


For Mac it worked for me running the following command (needed to have macports installed):

sudo port install py27-pyside-tools

It installs on my Python 2.7 environment. I hope it helps.

like image 45
Joepreludian Avatar answered Oct 02 '22 05:10

Joepreludian


Since a couple years passed by and some things were fixed: I guess the official answer would now be:

Use uic.exe! But how?

So although the official docs still lack any info about it you can now compile .ui files to Python directly with this executable shipped with the PySide2 package you get via pip install PySide2. This is how you would write it:

uic.exe -g python your_design.ui -o your_design_ui.py

Where your_design.ui is the Qt Designer file and your_design_ui.py the target Python file to generate. Voilà!

Btw: here is the help from uic -?

C:\Python38\Lib\site-packages\PySide2>uic.exe -h
Usage: uic.exe [options] [uifile]
Qt User Interface Compiler version 5.15.0

Options:
-?, -h, --help                Displays help on commandline options.
--help-all                    Displays help including Qt specific options.
-v, --version                 Displays version information.
-d, --dependencies            Display the dependencies.
-o, --output <file>           Place the output into <file>
-a, --no-autoconnection       Do not generate a call to
                                QObject::connectSlotsByName().
-p, --no-protection           Disable header protection.
-n, --no-implicit-includes    Disable generation of #include-directives.
-s, --no-stringliteral        Deprecated. The use of this option won't take
                                any effect.
--postfix <postfix>           Postfix to add to all generated classnames.
--tr, --translate <function>  Use <function> for i18n.
--include <include-file>      Add #include <include-file> to <file>.
-g, --generator <python|cpp>  Select generator.
--idbased                     Use id based function for i18n
--from-imports                Python: generate imports relative to '.'

Arguments:
[uifile]                      Input file (*.ui), otherwise stdin.
like image 30
ewerybody Avatar answered Oct 01 '22 05:10

ewerybody