[PySide] Packaging PySide2 for Fedora

Cristián Maureira-Fredes Cristian.Maureira-Fredes at qt.io
Wed Mar 27 08:58:22 CET 2019

Hello Richard,

yes, port_v2 is the support for Python2,
you can see a couple of import statements that look like:

  1     if sys.hexversion >= 0x03000000:                                                                
  2         from pyside2uic.port_v3.invoke import invoke                                                
  3     else:                                                                                           
  4         from pyside2uic.port_v2.invoke import invoke

inside "sources/pyside2-tools/pyside2-uic"
so it's really strange that is picking up port_v2 if you are using python3.

Maybe you can try to check what's your sys.hexversion,
and if it's a proper one, you can remove the import statements related to port_v2.


From: PySide <pyside-bounces at qt-project.org> on behalf of Richard Shaw <hobbes1069 at gmail.com>
Sent: Wednesday, March 27, 2019 01:22
To: Alexandru Croitor
Cc: pyside
Subject: Re: [PySide] Packaging PySide2 for Fedora

Ok, I gave up on the setuptools build and moved on to CMake. I've got everything building and installing but it fails during bytecompiling:

Bytecompiling .py files below /builddir/build/BUILDROOT/python-pyside2-5.12.1-1.fc31.x86_64/usr/lib/debug/usr/lib64/python3.7 using /usr/bin/python3.7
Bytecompiling .py files below /builddir/build/BUILDROOT/python-pyside2-5.12.1-1.fc31.x86_64/usr/lib64/python3.7 using /usr/bin/python3.7
*** Error compiling '/builddir/build/BUILDROOT/python-pyside2-5.12.1-1.fc31.x86_64/usr/lib64/python3.7/site-packages/pyside2uic/port_v2/invoke.py'...
  File "/usr/lib64/python3.7/invoke.py", line 36
    except IOError, e:
SyntaxError: invalid syntax

*** Error compiling '/builddir/build/BUILDROOT/python-pyside2-5.12.1-1.fc31.x86_64/usr/lib64/python3.7/site-packages/pyside2uic/port_v2/load_plugin.py'...
  File "/usr/lib64/python3.7/load_plugin.py", line 36
    except Exception, e:
SyntaxError: invalid syntax

Does the "port_v2" mean python2? Since I'm building this for future Fedora 31 which will basically be Python 3 only, can I remove these files?


More information about the PySide mailing list