You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a new environment with Orange, without Qt, because I only needed a headless Orange (use case: Orada). Importing orange results in the following error.
/Users/janez/miniforge3/envs/orada/bin/python /Users/janez/dev/orada/backend/app.py
Traceback (most recent call last):
File "/Users/janez/dev/orada/backend/dataset.py", line 11, in <module>
import Orange
File "/Users/janez/miniforge3/envs/orada/lib/python3.12/site-packages/Orange/__init__.py", line 4, in <module>
from Orange import data
File "/Users/janez/miniforge3/envs/orada/lib/python3.12/site-packages/Orange/data/__init__.py", line 4, in <module>
from .variable import *
File "/Users/janez/miniforge3/envs/orada/lib/python3.12/site-packages/Orange/data/variable.py", line 1, in <module>
from orangecanvas.utils.localization.si import plsi, plsi_sz, z_besedo
File "/Users/janez/miniforge3/envs/orada/lib/python3.12/site-packages/orangecanvas/utils/__init__.py", line 12, in <module>
from AnyQt.QtCore import Qt
File "/Users/janez/miniforge3/envs/orada/lib/python3.12/site-packages/AnyQt/QtCore.py", line 1, in <module>
from . import _api
File "/Users/janez/miniforge3/envs/orada/lib/python3.12/site-packages/AnyQt/_api.py", line 116, in <module>
raise ImportError("PyQt4, PyQt5, PySide or PySide2 are not available for import")
ImportError: PyQt4, PyQt5, PySide or PySide2 are not available for import
Process finished with exit code 1
This happens because pip instal orange3 runs Orange through trubar, which translates it. Translated orange imports from orangecanvas.utils.localization.si, which executes orangecanvas/utils/__init__.py, which in turn imports Qt. Since orangecanvas depends on Qt (though not through requirements, to allow using different versions of Qt), it has every right to import it.
I am reporting the problem here, though the first solution that comes to mind is to move localization module from orangecanvas.utils.localization to orangecanvas.localization to avoid importing Qt. Note after discussion with @markotoplak: the old location must still work (e.g. import * from the new location) otherwise we'd also have to re-release all add-ons.
This will affect anybody who wants to run headless Orange. This "anybody" probably doesn't mean "manybody", hence no need to rush into 3.38.1.
How can we reproduce the problem?
Create an environment, install Orange, import it.
What's your environment?
Operating system: macOS
Orange version: 3.38
How you installed Orange: pip
The text was updated successfully, but these errors were encountered:
janezd
added
bug report
Bug is reported by user, not yet confirmed by the core team
bug
A bug confirmed by the core team
and removed
bug report
Bug is reported by user, not yet confirmed by the core team
labels
Dec 10, 2024
What's wrong?
I created a new environment with Orange, without Qt, because I only needed a headless Orange (use case: Orada). Importing orange results in the following error.
This happens because
pip instal orange3
runs Orange throughtrubar
, which translates it. Translated orange imports fromorangecanvas.utils.localization.si
, which executesorangecanvas/utils/__init__.py
, which in turn imports Qt. Sinceorangecanvas
depends on Qt (though not throughrequirements
, to allow using different versions of Qt), it has every right to import it.I am reporting the problem here, though the first solution that comes to mind is to move
localization
module fromorangecanvas.utils.localization
toorangecanvas.localization
to avoid importing Qt. Note after discussion with @markotoplak: the old location must still work (e.g. import * from the new location) otherwise we'd also have to re-release all add-ons.This will affect anybody who wants to run headless Orange. This "anybody" probably doesn't mean "manybody", hence no need to rush into 3.38.1.
How can we reproduce the problem?
Create an environment, install Orange, import it.
What's your environment?
The text was updated successfully, but these errors were encountered: