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. PySide2 tutorial not working
Qt 6.11 is out! See what's new in the release blog

PySide2 tutorial not working

Scheduled Pinned Locked Moved Unsolved Qt for Python
pyside2
4 Posts 3 Posters 904 Views
  • 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.
  • M Offline
    M Offline
    MicheleGiacomini
    wrote on last edited by
    #1

    Hello,

    I am trying to follow along one of the Qt for Python tutorials at the official website. Specifically the Data Visualisation tutorial.

    Tryng to execute the code as is leads to the following error

    Traceback (most recent call last):
      File "main.py", line 8, in <module>
        from main_widget import Widget
      File "/Users/Michele/gits/data_visualisation_tutorial_Qt/main_widget.py", line 7, in <module>
        from table_model import CustomTableModel
      File "/Users/Michele/gits/data_visualisation_tutorial_Qt/table_model.py", line 5, in <module>
        class CustomTableModel(QAbstractTableModel):
    TypeError: 'Shiboken.ObjectType' object is not iterable
    

    By playing around with the code in the example it looks like python does not like to create a subclass of either QAbstractTableModel nor QWidget.

    Does anyone have any idea why this does not work?

    JonBJ 1 Reply Last reply
    0
    • M MicheleGiacomini

      Hello,

      I am trying to follow along one of the Qt for Python tutorials at the official website. Specifically the Data Visualisation tutorial.

      Tryng to execute the code as is leads to the following error

      Traceback (most recent call last):
        File "main.py", line 8, in <module>
          from main_widget import Widget
        File "/Users/Michele/gits/data_visualisation_tutorial_Qt/main_widget.py", line 7, in <module>
          from table_model import CustomTableModel
        File "/Users/Michele/gits/data_visualisation_tutorial_Qt/table_model.py", line 5, in <module>
          class CustomTableModel(QAbstractTableModel):
      TypeError: 'Shiboken.ObjectType' object is not iterable
      

      By playing around with the code in the example it looks like python does not like to create a subclass of either QAbstractTableModel nor QWidget.

      Does anyone have any idea why this does not work?

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @MicheleGiacomini
      Are you by any chance Python 3.8? python -V or --version

      1 Reply Last reply
      0
      • ewerybodyE Offline
        ewerybodyE Offline
        ewerybody
        wrote on last edited by
        #3

        Yeah Python 3.8 is not yet finished, right?
        I noticed just around xmas that I couldn't even pip install PySide2 on Python 3.8 but now it's working so far but when I just from PySide2 import QtWidgets I get an ImportError: DLL load failed ...

        Is there any further information about when its coming for 3.8? Are there any build issues?

        1 Reply Last reply
        0
        • ewerybodyE Offline
          ewerybodyE Offline
          ewerybody
          wrote on last edited by
          #4

          oops! See: https://forum.qt.io/post/570687

          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