labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
327 stars 164 forks source link

ImportError: cannot import name 'identity_realm_name_category' from 'autobahn.wamp.message' #1421

Closed BenM-github closed 2 months ago

BenM-github commented 2 months ago

Hi, I've been trying to set up a coordinator daemon for a test environment. When I run the coordinator and exporter manually via separate terminals, it works fine, but when I try to run them as a service, I get the following error message:

Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: Traceback (most recent call last): Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: File "/home/user/.conda/envs/crossbar-env/bin/crossbar", line 5, in <module> Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: from crossbar import run Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: File "/home/user/.conda/envs/crossbar-env/lib/python3.11/site-packages/crossbar/__init__.py", line 15, in <module> Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: from crossbar._util import hl Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: File "/home/user/.conda/envs/crossbar-env/lib/python3.11/site-packages/crossbar/_util.py", line 22, in <module> Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: from crossbar.common.checkconfig import InvalidConfigException Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: File "/home/user/.conda/envs/crossbar-env/lib/python3.11/site-packages/crossbar/common/checkconfig.py", line 22, in <module> Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: from autobahn.wamp.message import _URI_PAT_STRICT_NON_EMPTY, _URI_PAT_STRICT_LAST_EMPTY, \ Jun 11 15:30:20 workstation.domain.org crossbar[1546302]: ImportError: cannot import name 'identity_realm_name_category' from 'autobahn.wamp.message' (/home/user/.conda/envs/crossbar-env/lib/python3.11/site-packages/autobahn/wamp/message.py)

I'm not sure what this error is supposed to tell me. Have I forgotten some setting or am I missing a Python packet? At least pip check does not find any broken requirements.

Does anyone know why this error is occuring?

Don't know if it help but I run crossbar in an conda enviromnent with python 3.11.9. Under Python > 3.11.9 I get an import error. Also this is my labgrid-coordinator.service EXEC specification:

ExecStart=/home/user/.conda/envs/crossbar-env/bin/crossbar start --logformat=syslogd --cbdir /var/lib/labgrid-coordinator --config /etc/labgrid/coordinator.yaml ExecStop=/usr/bin/labgrid-coordinator stop --cbdir /var/lib/labgrid-coordinator

I hope its not just my lack of experience that caused this error.

jluebbe commented 2 months ago

You're installing crossbar into a separate environment, correct? Can you check if the installed packages match https://github.com/labgrid-project/labgrid/blob/master/crossbar-requirements.txt?

BenM-github commented 2 months ago

Yeah, the versions were too new. I installed the older version of crossbar and autobahn and now everything works perfectly.

It's kind of embarrassing that I didn't think of it myself. I just expected that the right versions were installed. 😅 Anyway, thank you very much 😄