Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to make run PySide6 in current Anaconda installation (conda 4.12.0)
Qt 6.11 is out! See what's new in the release blog

How to make run PySide6 in current Anaconda installation (conda 4.12.0)

Scheduled Pinned Locked Moved Unsolved Qt for Python
10 Posts 3 Posters 12.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pandreas
    wrote on last edited by
    #1

    Hi,

    I cannot make run PySide6 in Anaconda.

    I found several hints reporting similar problems. One of them is this:

    Re: PySide6 does not work with Anaconda

    But if I simply install Anaconda, I have matplotlib 3.4.3 and seemingly it does not contail PySide6. Using an example however I get ModuleNotFoundError: No module named 'PySide6' . Interestingly in the from PySide... statement te editor knows what is available when just typing "from Pyside6."

    Any ideas or just using PyQt5 until there is an Anaconda version without PySide6 problem?

    Best regards
    Andreas

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      The fact that your editor knows about something may not be relevant as it may get that information from other sources than your current environment.

      That said, how are you installing PySide6 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pandreas
        wrote on last edited by
        #3

        Thanks SGaist,
        I just typed
        pip install pyside6
        into the console of Spider.
        The test according to the tutorial worked:
        import PySide6.QtCore

        Prints PySide6 version

        print(PySide6.version)

        Prints the Qt version used to compile PySide6

        print(PySide6.QtCore.version)

        But it cannot show Qt windows, because the qt platform plugin is said to be missing.

        Is it asking for a dll? Anaconda seems to bring qt5 dlls.

        Best regards

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          AFAIK, conda currently does not provide PySide6.

          To determine what is happening you should start your script with the QT_DEBUG_PLUGINS environment variable set to 1.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pandreas
            wrote on last edited by
            #5

            Thanks.
            Sorry, maybe a stupid question: Just as a normal windows environment variable?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I guess your IDE should be able to provide the option to change the environment variables used when starting to run your script.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pandreas
                wrote on last edited by
                #7

                I do not know how to set it in Spider but it is displayed when I type env into console.

                But where to look for an output?

                when I debug line wise the error commes in this line :

                app = QApplication(sys.argv)

                I am not only new to qt but also to Python and Anaconda (coming from Java and Matlab), so that everything is still a little magic for me.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  I haven't use spyder so I can't tell you how to modify them in it.

                  The result output should be printed in the same window that shows the output of print statements,

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pandreas
                    wrote on last edited by
                    #9

                    Thanks. I gave up so far. Either Anaconda with PyQt5 ot Pyside6 with something else; Happy Easter!

                    1 Reply Last reply
                    0
                    • CristianMaureiraC Offline
                      CristianMaureiraC Offline
                      CristianMaureira
                      wrote on last edited by
                      #10

                      The problematic area here is that conda is really good to resolve extra dependencies for Python packages, like for example when you try to use the Python OpenGL bindings, but that means they require to have the proper configuration of Qt in their packages. That being said, modules like matplotlib might install a 'qt.conf' file that modify how Qt will work in your environment, which is problematic, because if you have PySide first, then PyQt might not work, and the other way around.

                      Officially, there is no conda packages for PySide6 provided by the Qt Project (nor the Qt company), and we only provide the ones on PyPi that you can get with pip install pyside6.

                      So why is that an issue? The wheels you install with pip include Qt binaries, and what if you already have Qt installed in your conda environment? then there will be a problem with all the configurations. This is the main reason on why we encourage users to use a vanilla Python interpreter, create a virtual environment and install pyside and all the other dependencies there.

                      If you really cannot do that, I'd recommend you to create another 'conda enviroment' and "try" to install there PySide6 and give it a try.

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved