fresh installation on Windows gives zmq errors

98 views
Skip to first unread message

Andreas Trenkwalder

unread,
May 28, 2024, 4:21:35 AMMay 28
to the labscript suite
Hi, I want to signal an error on a fresh installation of labscript-suite on Windows and its solution.

The error occurs with Python 3.10 on a newer computer and I could reproduce it with Python 3.8 on Windows 7.
 
We were following the "regular python" installation guide on a new virtual environment:

The first error occurs when starting blacs:
  File "<instdir>.venv\lib\site-packages\blacs\__main__.py", line 756, in <module>
    experiment_server = ExperimentServer(port)
  File "<path>.venv\lib\site-packages\labscript_utils\ls_zprocess.py", line 190, in __init__
    zprocess.ZMQServer.__init__(
  File "<path>.venv\lib\site-packages\zprocess\clientserver.py", line 483, in __init__
    _ZMQServer.__init__(self, port, dtype=dtype, pull_only=pull_only,
  File "<path>.venv\lib\site-packages\zprocess\clientserver.py", line 137, in __init__
    self.sock.bind('%s:%d' % (self.bind_address, self.port))
  File "<path>.venv\lib\site-packages\zprocess\security.py", line 217, in bind
    return self._bind_or_connect(addr, bind=True)
  File "<path>.venv\lib\site-packages\zprocess\security.py", line 204, in _bind_or_connect
    result = method(self, addr)
  File "<path>.venv\lib\site-packages\zmq\sugar\socket.py", line 311, in bind
    super().bind(addr)
  File "_zmq.py", line 898, in zmq.backend.cython._zmq.Socket.bind
  File "_zmq.py", line 160, in zmq.backend.cython._zmq._check_rc
zmq.error.ZMQError: No such device (addr='tcp://0.0.0.0:42517')

The problem is described here:

I have modified in <path>.venv/Lib/site-packages/labscript-utils/ls_zprocess.py line 170:
    bind_address='tcp://0.0.0.0',
changed to:
    bind_address='tcp://*',

After this blacs is starting but gives another similar error:

  File "C:\Python3\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "<path>.venv\lib\site-packages\zprocess\utils.py", line 122, in _reraise
    raise value.with_traceback(traceback)
  File "<path>.venv\lib\site-packages\blacs\__main__.py", line 272, in __init__
    self.tablist[device_name] = TabClass(self.tab_widgets[0],self.settings_dict[device_name])
  File "<path>.venv\lib\site-packages\blacs\device_base_class.py", line 36, in __init__
    Tab.__init__(self,notebook,settings,restart)
  File "<path>.venv\lib\site-packages\blacs\tab_base_classes.py", line 281, in __init__
    self._output_box = OutputBox(self._ui.splitter)
  File "<path>.venv\lib\site-packages\labscript_utils\qtwidgets\outputbox.py", line 27, in __init__
    qtutils.outputbox.OutputBox.__init__(
  File "<path>.venv\lib\site-packages\qtutils\outputbox.py", line 149, in __init__
    self.port = socket.bind_to_random_port(bind_address)
  File "<path>.venv\lib\site-packages\zmq\sugar\socket.py", line 499, in bind_to_random_port
    self.bind("%s:*" % addr)
  File "<path>.venv\lib\site-packages\zprocess\security.py", line 217, in bind
    return self._bind_or_connect(addr, bind=True)
  File "<path>.venv\lib\site-packages\zprocess\security.py", line 204, in _bind_or_connect
    result = method(self, addr)
  File "<path>.venv\lib\site-packages\zmq\sugar\socket.py", line 311, in bind
    super().bind(addr)
  File "_zmq.py", line 898, in zmq.backend.cython._zmq.Socket.bind
  File "_zmq.py", line 160, in zmq.backend.cython._zmq._check_rc
zmq.error.ZMQError: No such device (addr='tcp://0.0.0.0:*')

I have changed also this file <path>.venv/lib/site-packages/labscript-utils/qtwidgets/outputbox.py line 32:
    bind_address='tcp://0.0.0.0',
change to:
    bind_address='tcp://*',

This has solved the issue and blacs, runmanager, runviewer and lyse start without further issues.

Andreas

Philip Starkey

unread,
Jun 15, 2024, 11:05:02 AMJun 15
to the labscript suite
Hi Andreas,

Would you be able to share your pyzmq version number? This is an odd error, and it would be good to work out if we've done something wrong or pyzmq/zmq have broken something in a recent release (it has been working fine this way for many, many years...).

Out of interest, what version of Windows are you running on the newer PC? I'm not sure pyzmq supports windows 7 anymore so I'm not surprised you ran into issues on the older one.

Cheers,
Phil

Andreas Trenkwalder

unread,
Jun 18, 2024, 4:58:23 PMJun 18
to labscri...@googlegroups.com
Hi Phil,

below the version numbers on Windows.

I was wrong with the Windows version on which I could reproduce the
error seen by my colleague, I thought it is Windows 7 but it is
instead Windows 10 (dual boot, but I rarely work there). I do not know
what Windows version my colleague was using, but I can ask him of
course. From the screenshot he sent me I think he saw the second error
which I have described but he started runmanager while I started
blacs.

Python version 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03)
[MSC v.1928 64 bit (AMD64)]
PyZMQ version: 26.0.3
ZMQ version: 4.3.5
zprocess version: 2.24.0
labscript_utils version: 3.3.1
BLACS version: 3.2.1

Another colleague told me after I have posted my message, that he has
seen similar errors several times and they usually install an older
pyzmq version. I think he refers to this post from last year:
https://groups.google.com/g/labscriptsuite/c/lCx2YSui-pc/m/NF1yeAh4AgAJ
There Chris suggests to downgrade pyzmq to version below 25.0.

I was not sure if it is good to post this kind of messages on the
google group or on the github as issue, but I thought the solution
might help other users as well.

Many thanks for taking the time and developing and maintaining labscript!
We have now several labs switching to labscript-suite which is a great tool.

Andreas
> --
> You received this message because you are subscribed to a topic in the Google Groups "the labscript suite" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/labscriptsuite/q_gMVD-W8hE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to labscriptsuit...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/68fc55f9-9ca3-4891-822b-e26925480915n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages