question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZMQ ioloop.install crash Windows 10 Python 3.8

See original GitHub issue

This is specific to (in the testing I have done so far):

  • Windows 10
  • Python 3.8

a workaround it to create a Python 3.7 environment

I have a clean python 3.8 environment created using conda,

conda create --name pvtrace-test-2.1.4 python=3.8
conda activate pvtrace-test-2.1.4
conda install Rtree
pip install pvtrace

I downloaded the box.py example and ran it

python box.py

and I get the following traceback,

C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py:28: DeprecationWarning: zmq.eventloop.ioloop is deprecated in pyzmq 17. pyzmq now works with default tornado and asyncio eventloops.
  ioloop.install()
Traceback (most recent call last):
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\runpy.py", line 194, in _run_module_as_main
Traceback (most recent call last):
  File "box.py", line 8, in <module>
    return _run_code(code, main_globals, None,    vis = meshcat.Visualizer().open()

  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\visualizer.py", line 108, in __init__
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\runpy.py", line 87, in _run_code
    self.window = ViewerWindow(zmq_url=zmq_url, start_server=(zmq_url is None))
      File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\visualizer.py", line 43, in __init__
exec(code, run_globals)
    self.zmq_url = match_zmq_url(self.server_proc.stdout.readline().strip().decode("utf-8"))
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py", line 235, in <module>
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\visualizer.py", line 26, in match_zmq_url
    return capture(r"^zmq_url=(.*)$", line)
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\visualizer.py", line 21, in capture
        raise ValueError("Could not match {:s} with pattern {:s}".format(s, pattern))
main()ValueError: Could not match <class 'NotImplementedError'> with pattern ^zmq_url=(.*)$

  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py", line 226, in main
    bridge = ZMQWebSocketBridge(zmq_url=results.zmq_url)
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py", line 95, in __init__
    (self.zmq_socket, self.zmq_stream, self.zmq_url), _ = find_available_port(f, DEFAULT_ZMQ_PORT)
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py", line 46, in find_available_port
    return func(port), port
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py", line 94, in f
    return self.setup_zmq("{:s}://{:s}:{:d}".format(DEFAULT_ZMQ_METHOD, self.host, port))
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\meshcat\servers\zmqserver.py", line 202, in setup_zmq
    zmq_stream = ZMQStream(zmq_socket)
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\zmq\eventloop\zmqstream.py", line 127, in __init__
    self._init_io_state()
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\zmq\eventloop\zmqstream.py", line 552, in _init_io_state
    self.io_loop.add_handler(self.socket, self._handle_events, self.io_loop.READ)
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Users\daniel.farrell\AppData\Local\Continuum\anaconda3\envs\pvtrace-test-2.1.4\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

Using Python 3.8.5

These are the installed packages

anytree          2.8.0
attrs            20.1.0
certifi          2020.6.20
chardet          3.0.4
colorama         0.4.3
colorlog         4.2.1
decorator        4.4.2
idna             2.10
jsonschema       3.2.0
lxml             4.5.2
meshcat          0.0.18
mkl-fft          1.1.0
mkl-random       1.1.1
mkl-service      2.3.0
mpmath           1.1.0
msgpack          1.0.0
networkx         2.5
numpy            1.19.1
pandas           1.1.1
Pillow           7.2.0
pip              20.2.2
pvtrace          2.1.4
pycollada        0.7.1
pyglet           1.5.7
pyrsistent       0.16.0
python-dateutil  2.8.1
pytz             2020.1
pyzmq            19.0.2
requests         2.24.0
Rtree            0.9.4
scipy            1.5.2
setuptools       49.6.0.post20200814
Shapely          1.7.1
six              1.15.0
svg.path         4.0.2
sympy            1.6.2
tornado          6.0.4
trimesh          3.8.5
u-msgpack-python 2.7.0
urllib3          1.25.10
wheel            0.35.1
wincertstore     0.2
xxhash           2.0.0

Any ideas on how I can work around this problem? Maybe I need to use an earlier version of meshcat?

This seems to be a problem with Python 3.8 on Window 10.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
danieljfarrellcommented, Nov 18, 2020

So if meshcat-python sets tornado>=6.1.0 in requirements.txt we should be good!

0reactions
dcambiecommented, Nov 18, 2020

@danieljfarrell The issue is fixed by tornado 6.1.0 for me, so this workaround is not needed anymore.

FYI With current meshcat-python master (i.e. after #81 was merged) I can run pvtrace (and box.py fwiw) in a fresh Python3.8 conda environment both on work and personal PC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changes in PyZMQ — PyZMQ 25.0.0b1 documentation
Due to a libzmq bug causing unavoidable crashes for some users, Windows wheels ... Python 3.8 prerelease by regenerating Cython sources with Cython...
Read more >
Spyder IDE fails to start on Windows 10 with Python 3.8
I was able to fix the import error by running pywin32_postinstall.py -install from the scripts folder (from a cmd prompt with elevated rights)....
Read more >
tornado.ioloop — Main event loop
configure method cannot be used on Python 3 except to redundantly specify the asyncio event loop. Deprecated since version 6.2: It is deprecated...
Read more >
pyzmq · PyPI
Python bindings for 0MQ. ... This package contains Python bindings for ZeroMQ. ... but compiling from source with pip install pyzmq should work...
Read more >
Error: install JupyterLab on FreeBSD 13 - Reddit
Hi All, I am trying to install JupyterLab on FreeBSD 13 and I get the ... zmq/error.py -> build/lib.freebsd-13.0-RELEASE-p7-amd64-3.8/zmq ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found