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've got automated tests for Jupyter notebooks in an Azure DevOps pipeline that runs each notebook like this in Python 3.9 on Windows: jupyter nbconvert --to html --execute my-notebook.ipynb
Normally, before all my tests I like to set PYTHONWARNINGS=error, so that the tests will fail if any warnings crop up. However if I do this, the execution of each notebook seems to get stuck in a (permanent?) loop like this below; I end up having to cancel the pipeline run manually.
[NbConvertApp] ERROR | Error occurred while starting new kernel client for kernel 5492de13-625c-40ec-85f7-8e604be9b877: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.
Exception in callback _AsyncPoller.poll.<locals>.<lambda>(<Future cancelled>) at C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\zmq\_future.py:107
handle: <Handle _AsyncPoller.poll.<locals>.<lambda>(<Future cancelled>) at C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\zmq\_future.py:107>
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\zmq\_future.py", line 107, in <lambda>
lambda f: self._unwatch_raw_sockets(loop, *raw_sockets)
File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\zmq\asyncio.py", line 132, in _unwatch_raw_sockets
selector = _get_selector(loop)
File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\zmq\asyncio.py", line 60, in _get_selector_windows
warnings.warn(
RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.
Is this issue related to zeromq/pyzmq#1423? My tests were with Python 3.9.13 and pyzmq 26.2.0 on Windows. pip installing tornado (6.4.1) makes no difference.
If I don't set PYTHONWARNINGS then each notebook runs successfully, but with:
C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\zmq\_future.py:724: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.
self._get_loop()
So, does nbconvert code need to call asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy()) when running on Windows, as suggested by zeromq/pyzmq#1423? I'd prefer to test my Jupyter notebooks with PYTHONWARNINGS=error.
I've got automated tests for Jupyter notebooks in an Azure DevOps pipeline that runs each notebook like this in Python 3.9 on Windows:
jupyter nbconvert --to html --execute my-notebook.ipynb
Normally, before all my tests I like to set
PYTHONWARNINGS=error
, so that the tests will fail if any warnings crop up. However if I do this, the execution of each notebook seems to get stuck in a (permanent?) loop like this below; I end up having to cancel the pipeline run manually.Is this issue related to zeromq/pyzmq#1423? My tests were with Python 3.9.13 and pyzmq 26.2.0 on Windows. pip installing tornado (6.4.1) makes no difference.
If I don't set PYTHONWARNINGS then each notebook runs successfully, but with:
So, does nbconvert code need to call
asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())
when running on Windows, as suggested by zeromq/pyzmq#1423? I'd prefer to test my Jupyter notebooks withPYTHONWARNINGS=error
.Output of
jupyter --version
:The text was updated successfully, but these errors were encountered: