leon-thomm / Ryven

Flow-based visual scripting for Python
https://ryven.org
MIT License
3.76k stars 439 forks source link

pyqtSignal() argument expected to be sequence of types on startup #159

Closed erwanp closed 11 months ago

erwanp commented 1 year ago

Ryven doesn't start after install,

After running

ryven

in the console

I get :

Traceback (most recent call last):
  File "C:\Users\erwan\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\erwan\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\erwan\Anaconda3\Scripts\ryven.exe\__main__.py", line 7, in <module>
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryven\main\Ryven.py", line 68, in run
    from ryven.gui_env import init_node_guis_env    # Qt dependency
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryven\gui_env.py", line 2, in <module>
    from ryven.main.packages.gui_env import *
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryven\main\packages\gui_env.py", line 8, in <module>
    import ryven.gui.std_input_widgets as inp_widgets
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryven\gui\std_input_widgets.py", line 9, in <module>
    from ryvencore_qt import NodeInputWidget
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryvencore_qt\__init__.py", line 12, in <module>
    from .src.SessionGUI import SessionGUI
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryvencore_qt\src\SessionGUI.py", line 8, in <module>
    from .flows.FlowView import FlowView
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryvencore_qt\src\flows\FlowView.py", line 32, in <module>
    class FlowView(GUIBase, QGraphicsView):
  File "C:\Users\erwan\Anaconda3\lib\site-packages\ryvencore_qt\src\flows\FlowView.py", line 41, in FlowView
    check_connection_validity_request = Signal((NodeOutput, NodeInput), bool)
TypeError: pyqtSignal() argument expected to be sequence of types
(base)

Windows environnemnt Ryvan installed from pip with pip install ryven --pre ryven 3.4.0a2 ryvencore 0.4.0a13 ryvencore-qt 0.4.0a2 QtPy 1.10.0

erwanp commented 1 year ago

Works well with conda install

ausstein commented 11 months ago

I get the same Issue with the conda install :(

leon-thomm commented 11 months ago

At the time OP posted the issue, only the previous version was available on Anaconda (not the --pre one). Now on both pip and conda it's Ryven v3.4.

In the traceback above Python tries to use a PyQt class. Ryven is not compatible with PyQt, it should run on PySide2. Ryven uses qtpy which allows selecting different Qt backends (including PyQt) but Ryven selects the PySide2 backend by default, so if that is not overridden by the user I don't think it's a Ryven issue. You can try to make a new environment and only install Ryven.

ausstein commented 11 months ago

I did a fresh environment, I tried it both on Linux and windows as well as with different python versions. Always the same error

ausstein commented 11 months ago

Okay I have it set up to always install numpy scipy and matplotlib into my fresh environments because they are essential for me. Turns out installing matplotlib causes the issues. I would be grateful for a solution!

ausstein commented 11 months ago

Okay simply setting environment Variable "QT_API" to "PySide2" works !!

ausstein commented 11 months ago

in ryven.py

from ryven.gui_env import init_node_guis_env # Qt dependency

comes before

os.environ['QT_API'] = conf.qt_api

which causes the issue. I created a pull request