pyzmq: pyzmq 26, Windows 11: Bad file descriptor
This is a pyzmq bug
- This is a pyzmq-specific bug, not an issue of zmq socket behavior. Don’t worry if you’re not sure! We’ll figure it out together.
What pyzmq version?
26.0.0
What libzmq version?
none
Python version (and how it was installed)
3.12.3
OS
windows 11
What happened?
When installing jupyter on a new windows machine, it will fail to connect to any python3 kernel, with the following error popup: “Error Starting KernelNetworkError when attempting to fetch resource.”
To reproduce: On a Powershell on a Windows 11 machine with python 3.12.3:
'pip install jupyter'
'python -m jupyter notebook' or 'jupyter-lab'
start a new notebook, or open an existing one, with python3 kernel
process fails and error pops up. In the shell I get the following output:
"Bad file descriptor (C:\Users\runneradmin\AppData\Local\Temp\tmp9czwcdbh\build_deps\bundled_libzmq-src\src\epoll.cpp:73)"
It works after I uninstall pyzmq and reinstall the Dec 5, 2023 version:
'pip freeze | findstr pyzmq'
output: "pyzmq==26.0.0"
'pip uninstall pyzmq'
'pip install pyzmq==25.1.2'
Code to reproduce bug
pip install jupyter
python -m jupyter notebook' or 'jupyter-lab
Traceback, if applicable
Bad file descriptor (C:\Users\runneradmin\AppData\Local\Temp\tmp9czwcdbh\build_deps\bundled_libzmq-src\src\epoll.cpp:73)
More info
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 29 (10 by maintainers)
Same here! I had the same error and the way i fixed it was by downgrading pyzmq to the version 25.1.2 (I was on the 26.0.3 version). Run windows powershell and unintstall the current version by using this command:
python -m pip uninstall pyzmq
Then install the version i talked about:
pip install pyzmq==25.1.2
Hope it helps!
I finally managed to trigger this! On one of my VMs, when I create a user with a non-ascii username (日本語), the error is produced. Same Python, same pyzmq with an ascii username has no issue. So somewhere wepoll and/or libzmq and/or Windows itself is doing something really weird.
That means that in at least one case, I can confirm #2024 fixes this (the same fix as earlier)
I believe from above reports that this is not the only thing that causes epoll to fail on Windows, but it is enough, and unavoidable for affected users, that I think disabling epoll until libzmq can come up with a fix is the right move.
It is in the same general category of “a libzmq build is not compatible with a specific Windows situation” which can have many different causes, but often looks the same. Neither the affected Windows/Python nor the affected libzmq are the same, so no test could have caught both failures, and it’s frustrating for me because it has nothing to do with pyzmq, it’s all in libzmq.
Fortunately, it looks like this one might be feasible to reproduce, unlike the previous round, and the pyzmq 26 build system has more control over how libzmq is built, so I have a little more hope that someone can figure this one out.
Thanks everyone for reporting!