Error running pyuic6

Panagiotis Iosif paniosif at gmail.com
Tue Jun 25 09:35:52 BST 2024


Hi Detlev,

thanks for bringing this to my attention and for mentioning the possible
solutions.

I just subscribed to this mailing list and did not know this was a known
issue.

in case it proves useful to someone else, I did a quick fix by replacing:

"Qt::Horizontal" with "Qt::Orientation::Horizontal"
and "Qt::Vertical" with "Qt::Orientation::Vertical"

in the *def orientation(self, widget, prop) *method located in my
"PyQt6/uic/properties.py" file.

Best regards,
Panagiotis




On Mon, Jun 24, 2024 at 6:52 PM Detlev Offenbach <detlev at die-offenbachs.de>
wrote:

> Hi,
>
> you are facing the same issue that I reported some time ago already. Phil
> has changed the sources to cope with the current situation, which is caused
> by a change in Qt Designer starting with Qt 6.7.0. Your possible solutions
> are as follows.
>
> 1. Use the PyQt6 6.7.1 provided by Phil through his lokal PyPI server.
>
> 2. Use Qt Designer of Qt 6.6.x.
>
> I opted for the second solution for the moment.
>
> Regards,
> Detlev
> Am 24.06.24 um 15:09 schrieb Panagiotis Iosif:
>
> Hello,
>
> I am facing an issue when trying to run *pyuic6 *to convert my ".ui" file
> to a ".py" file.
>
> The command I am running is this one:
> pyuic6 tabs.ui -o tabs.py
>
> An the error I get says the following:
> ----------
> An unexpected error occurred.
> Check that you are using the latest version of pyuic6 and send an error
> report
> to the PyQt mailing list and include the following information:
> - your version of pyuic6 (6.7.0)
> - the .ui file that caused this error
> - the debug output of pyuic6 (use the --debug flag when calling pyuic6)
> ----------
>
> As per the error's instructions, I am attaching the "tabs.ui" file and the
> output of the command:
> pyuic6 tabs.ui -o tabs.py --debug 2>&1 | tee -a pyuic6_output.log
>
> I suspect that when I save the files "tabs.ui" from Qt Designer, the
> property "Orientation" gets saved as "Qt::Orientation::Horizontal".
>
> However, the file "properties.py" that resides in my miniconda
> installation at:
>
>
> /home/paniosif/miniconda3/envs/ahead3/lib/python3.9/site-packages/PyQt6/uic/properties.py
>
> probably handles "Orientation" differently.
>
> For example, checking the contents of that file and searching for the
> keyword "Orientation" this is what I see:
> ----------
> def orientation(self, widget, prop):
>         # If the class is a QFrame, it's a line.
>         if widget.metaObject().className() == 'QFrame':
>             widget.setFrameShape(
>                 {'Qt::Horizontal': QtWidgets.QFrame.Shape.HLine,
>                  'Qt::Vertical'  :
> QtWidgets.QFrame.Shape.VLine}[prop[0].text])
>         else:
>             widget.setOrientation(self._enum(prop[0]))
> ----------
>
> Does anyone have an idea as to how I can solve this issue?
>
> (I guess I can always manually edit either "properties.py" stored in the
> "uic" folder or my "tabs.ui" file as needed to make sure they agree on the
> definition of "Qt::Orientation::Horizontal".
>
> I do not know though if this works as it should.
>
> I would expect that saving a ".ui" file through Qt Designer (version
> 6.7.0) would respect whatever definitions of properties are needed from
> "uic".
>
> Am I missing something?
>
> Thanks for any help!
>
> Best,
> Panagiotis
>
>
> --
> Detlev Offenbachdetlev at die-offenbachs.de
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240625/fbc8a0be/attachment-0001.htm>


More information about the PyQt mailing list