SeanezLab / BoMI-StartReact

https://seanezlab.github.io/BoMI-StartReact/
0 stars 0 forks source link

Error with PySide 6.5 #20

Open seasonedfish opened 1 year ago

seasonedfish commented 1 year ago

Running bomi with PySide 6.5 results in this error:

C:\Users\Lab\Downloads\BoMI-StartReact\.venv\Scripts\python.exe -m bomi 
finished
[Yost Device Manager] Discovered 0 dongles, 2 sensors
[Yost Device Manager] 12000D88 Tared: True
[Yost Device Manager] 12000D65 Tared: True
[Start React] Selected sensor changed to 12000D88
write_meta {'subject_id': 'Enter S00#', 'joint': 'Enter TaskJointSide', 'max_rom': -1, 'sham': "Enter 'sham' or 'none'", 'stim': False}
Traceback (most recent call last):
  File "C:\Users\Lab\Downloads\BoMI-StartReact\bomi\scope_widget.py", line 457, in showEvent
    self.init_ui()
  File "C:\Users\Lab\Downloads\BoMI-StartReact\bomi\scope_widget.py", line 501, in init_ui
    plot: pg.PlotItem = glw.addPlot(row=row, col=0)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lab\Downloads\BoMI-StartReact\.venv\Lib\site-packages\pyqtgraph\graphicsItems\GraphicsLayout.py", line 72, in addPlot
    plot = PlotItem(**kargs)
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\Lab\Downloads\BoMI-StartReact\.venv\Lib\site-packages\pyqtgraph\graphicsItems\PlotItem\PlotItem.py", line 158, in __init__
    self.titleLabel = LabelItem('', size='11pt', parent=self)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lab\Downloads\BoMI-StartReact\.venv\Lib\site-packages\pyqtgraph\graphicsItems\LabelItem.py", line 19, in __init__
    GraphicsWidget.__init__(self, parent)
  File "C:\Users\Lab\Downloads\BoMI-StartReact\.venv\Lib\site-packages\pyqtgraph\graphicsItems\GraphicsWidget.py", line 16, in __init__
    QtWidgets.QGraphicsWidget.__init__(self, *args, **kargs)
  File "C:\Users\Lab\Downloads\BoMI-StartReact\.venv\Lib\site-packages\pyqtgraph\graphicsItems\GraphicsWidgetAnchor.py", line 20, in __init__
    self.geometryChanged.connect(self.__geometryChanged)
RuntimeError: '__init__' method of object's base class (LabelItem) not called.
seasonedfish commented 1 year ago

Looks like this may relate to PySide.

Working 3.10 env deps:

(bomi) PS C:\Users\Lab\Downloads\BoMI-StartReact> python --version
Python 3.10.0
(bomi) PS C:\Users\Lab\Downloads\BoMI-StartReact> pip list
Package           Version  Editable project location
----------------- -------- --------------------------------------
black             23.3.0
BoMI              0.3.0    C:\Users\Lab\Downloads\BoMI-StartReact
click             8.1.3
colorama          0.4.6
mypy              1.3.0
mypy-extensions   1.0.0
numpy             1.24.3
packaging         23.1
pathspec          0.11.1
pip               23.0.1
platformdirs      3.5.1
PyOpenGL          3.1.7
pyqtgraph         0.12.3
pyserial          3.5
PySide6           6.2.3
qtm               2.1.1
scipy             1.10.1
setuptools        67.8.0
shiboken6         6.2.3
tomli             2.0.1
types-setuptools  67.8.0.0
typing_extensions 4.6.3
wheel             0.38.4

Broken 3.11 env deps:

(.venv) (bomi) PS C:\Users\Lab\Downloads\BoMI-StartReact> python --version
Python 3.11.4
(.venv) (bomi) PS C:\Users\Lab\Downloads\BoMI-StartReact> pip list
pathspec           0.11.1
pip                23.1.2
platformdirs       3.6.0
PyOpenGL           3.1.7
pyqtgraph          0.12.4
pyserial           3.5
PySide6            6.5.1.1
PySide6-Addons     6.5.1.1
PySide6-Essentials 6.5.1.1
qtm                2.1.2
scipy              1.10.1
setuptools         65.5.0
shiboken6          6.5.1.1
types-setuptools   67.8.0.0
typing_extensions  4.6.3
seasonedfish commented 1 year ago

no way image

seasonedfish commented 1 year ago

Confirmed this error also happens on 3.10 with conda. So it really is an issue with PySide.

seasonedfish commented 1 year ago

In https://github.com/SeanezLab/BoMI-StartReact/commit/11ef6c8f24f7db1d953c2668b6d5a4119b577984, we add an additional specifier to avoid this issue. When we want to upgrade PySide, we'll have to revisit this.

kwsp commented 1 year ago

Gotta check which version of PySide6 pyqtgraph supports...

kwsp commented 1 year ago

If you can confirm this only happens inside pyqtgraph, you should raise an issue with them, since they explicitly support Qt6.2+

https://github.com/pyqtgraph/pyqtgraph