After updating fedora 40 PySide6 in Python it does not work

I am learning to use the Qt6 controls with Pyside6, but after the last update I could no longer run this code and it tells me that there is a Segment Fault (‘core’ generated), and before the last update I could run it without problems, now I have tested the same code using PyQt6 and it has not presented any problems and it runs perfectly, I don’t know if you could help me here, and if not I would appreciate it if you could tell me where I can continue searching to solve this error thank you

It is in the screenshot of the error when trying to execute the code

my system info

info about vscode
Captura desde 2024-05-06 17-37-42

There are some differences between PySide6 and PyQT6. Not many, but sometimes code written for one fails to function in the other.

Both are available and both can be installed at the same time.

Just an FYI
Please always post the text that you copy & paste as preformatted text (the </> button on the toolbar). Images are larger than the equivalent text, are not searchable, and are sometimes difficult to read.

1 Like

I seem to recall that there has been some changes in pyside6 vs pyqt6. It seems they may now be coming from the same source and merging since there was a lot of code duplicated. Was just reading about that recently.

This is from a year ago.

I’ve encountered the same problem, after updating the entire packages with ‘dnf update’ last week, PySide6, which I am using with venv, spit out a core dump and stopped working, even for a simple ‘Hello world’ type GUI program. I’ve never had this happen before with Fedora. :sob:

Since I could not find out which package(s) is/are causing this problem using QT_DEBUG_PLUGINS=1 flag unfortunately, and since I am using some important applications on the PySide6 almost everyday, I had no choice but to switch OS from Fedora 40 to RHEL 9.4 to use these applications with the PySide6.

The actual backtrace for the core dump would probably be useful.

Since you are both working in virtualenvs (and since there is no python-pyside6 package in Fedora 40 anyway*), you are using the binary wheels from PySide6 · PyPI. That doesn’t rule out the problem being in a Fedora package, but it’s relevant.

*At least, not yet – there may be a backport after some packaging issues are worked out in Rawhide.

Are you able to upload a simple test application source that reproduces the problem, similar to the main.py in the first screenshot? I haven’t upgraded my main system to Fedora 40 yet, but it would be interesting to try to reproduce this when I do.

I made repository on my github to reproduce the problem.

Tested OS is Fedora Linux 40 Workstation x86_64 on GNOME Boxes.

After installing the Fedora, update packages and reboot.

bitwalk@fedora:~$ **sudo dnf update -y**
...
...

Complete!
bitwalk@fedora:~$ **sudo reboot**

After rebooting, clone the repository and run the sample in the following.

bitwalk@fedora:~$ **git clone https:\/\/github.com/bitwalk123/pyside-test.git**
Cloning into 'pyside-test'...
remote: Enumerating objects: 11, done.
...
...
bitwalk@fedora:~$ **cd pyside-test**
bitwalk@fedora:~/pyside-test$ **python3 -m venv venv**
bitwalk@fedora:~/pyside-test$ **source venv/bin/activate**
(venv) bitwalk@fedora:~/pyside-test$ **pip install -r requirements.txt**
...
...
Successfully installed PySide6-Addons-6.7.0 PySide6-Essentials-6.7.0 pip-chill-1.0.3 pyside6-6.7.0 setuptools-69.5.1 shiboken6-6.7.0

[notice] A new release of pip is available: 23.3.2 -> 24.0
[notice] To update, run: pip install --upgrade pip
(venv) bitwalk@fedora:~/pyside-test$ **pip install --upgrade pip**
Successfully installed pip-24.0
(venv) bitwalk@fedora:~/pyside-test$ **python main.py**
Segmentation fault (core dumped)
(venv) bitwalk@fedora:~/pyside-test$

Screenshot_fedora_40_updated

Hope to reproduce the problem with this. :+1:

FYI:
On RHEL9.4, the sample can be executed in the same way.

Screenshot_rhel94

FYI (2)

main.py is a quite simple script:

import sys
from PySide6.QtWidgets import (
    QApplication,
    QLabel,
    QVBoxLayout,
    QWidget,
)


class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('Hello World!')

        vbox = QVBoxLayout()
        self.setLayout(vbox)

        lab = QLabel('Hello World!')
        vbox.addWidget(lab)


def main():
    app = QApplication(sys.argv)
    ex = Example()
    ex.show()
    sys.exit(app.exec())


if __name__ == '__main__':
    main()

Same for me after upgrading to Fedora 40 (KDE spin). Tried pyside6(-essentials) 6.7 and 6.6.x with Python script that used to work in 39.

The crash occurs when importing anything pyside6-related (e.g. import PySide6 => BAM).

2 Likes

Please check 2279088 – Segmentation fault in PyType_Ready called from Shiboken::init() since python3.12-3.12.3-2 and Loading.... It looks like these correspond to the issue reported here. It doesn’t look like there is a fix available yet, but at least it’s something to track.

3 Likes

I downgraded to Python 3.12.2 using sudo dnf downgrade python3 and PySide6 (tested with 6.6.3.1 and 6.7.0) applications work again.

3 Likes

Alternatively, install python3-shiboken6 and python3-pyside6 from the Fedora 41 (rawhide) build here: python-pyside6-6.7.0-1.fc41 | Build Info | koji

If you’re using python3 -m venv, just symlink like this (from the directory where your venv lives):

ln -s /usr/lib/python3.12/site-packages/shiboken6 lib/python3.12/site-packages/
ln -s /usr/lib64/python3.12/site-packages/shiboken6-6.7.0-py3.12.egg-info lib/python3.12/site-packages/
ln -s /usr/lib/python3.12/site-packages/PySide6 lib/python3.12/site-packages/
ln -s /usr/lib64/python3.12/site-packages/PySide6-6.7.0-py3.12.egg-info lib/python3.12/site-packages/

This works with python3.12-3.12.3-2.fc40 at least…

2 Likes

It worked for me too.