[Python] Unable to use PySide6 on NixOS : qt.qpa.plugin: From 6.5.0, xcb-cursor0 or...

Discussão em 'Python' iniciado por Stack, Dezembro 2, 2024.

  1. Stack

    Stack Membro Participativo

    I have been unable to use PySide6 on NixOS, I tried to install pyside from nixpkgs, pip and conda but I end up with the same result. I have this example file:

    from PySide6.QtWidgets import QApplication, QWidget

    # Only needed for access to command line arguments
    import sys

    # You need one (and only one) QApplication instance per application.
    # Pass in sys.argv to allow command line arguments for your app.
    # If you know you won't use command line arguments QApplication([]) works too.
    app = QApplication(sys.argv)

    # Create a Qt widget, which will be our window.
    window = QWidget()
    window.show() # IMPORTANT!!!!! Windows are hidden by default.

    # Start the event loop.
    app.exec()


    Which should open an example window, but I have the following error:

    $ python qt.py
    qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

    Available platform plugins are: vnc, vkkhrdisplay, linuxfb, minimalegl, xcb, eglfs, offscreen, minimal, wayland, wayland-egl.

    Aborted (core dumped)


    I have tried other solutions online, like installing xcb-util-cursor from nixpkgs, but nothing seemed to help. I am on the unstable branch of nixpkgs. Has anyone been able to make pyside6 work in your nixos setup?

    Continue reading...

Compartilhe esta Página