-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Python wheels: Bad address src\epoll.cpp:100 #1505
Comments
Can you test with current pyzmq 22.0.2? As far as I am aware, all of these issues are fixed in the latest release. pyzmq has no control over error messages from the C runtime thrown by the underlying libzmq. |
Sure, I will have a look and let you know. But could you stop letting them push 21.0.2 as dependencies? Thanks! |
Who are 'they'? If you |
Thank you for testing and confirming this is an issue in the current version! Can you run:
and share the output? Also, can you share some more information about your environment, so I can learn a bit about what makes your environment different from all of our tests?
@bluca any hints as to why this epoll_ctl assert would fail on Windows? This is using the libzmq-v141-x64-4_3_4 artifact on bintray.
I'm sorry, I really don't know what you mean by this. Anyone is free to install any version, so this is already the case. |
Sorry, don't know - maybe @sigiesec can help |
@minrk Sorry for the late reply, I will try my best to test these on a new computer as soon as I can(to avoid damaging my environment). Thank you! All the package versions are listed below. absl-py 0.11.0 |
Thanks for the info! I'll see if I can figure out how to debug it. Since it does not occur on my Windows VMs, I don't really feel like I have any actions available at the moment. Were you able to run pyzmq tests with the commands I gave above? That might help narrow down the issue.
You do have a choice. You can always specify pinning of any package in the install command. For example:
ipykernel does not request 'pyzmq==22.0.2', it requests 'pyzmq' which gets the latest version by default. If you want to specify a different version, you can do that.
If you are using conda, it's a good idea to use conda to install packages like tensorflow and pyzmq that have DLL dependencies instead of mixing conda and pip. Tensorflow wheels in particular are known to have serious compatibility issues. For example:
to create an environment called 'tensorflow' with tensorflow-gpu and jupyterlab with Python 3.8. |
@minrk the result is: |
@zhanggyarcher could you download |
@minrk nothing has displayed, no error message |
I am having error while installing pyzmq 19.0.2 (base) C:\Users\Cipher_X>failed (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X>to be incompatible with the existing python installation in your environment: (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X>not available for the python version you are constrained to. Note that conda will not (base) C:\Users\Cipher_X>change your python version to a different minor version unless you explicitly specify (base) C:\Users\Cipher_X>that. (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X> (base) C:\Users\Cipher_X>anaconda -> bleach==2.1.4=py27_0 -> html5lib[version='>=0.99999999|>=0.99999999pre,!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8'] (base) C:\Users\Cipher_X>anaconda -> html5lib[version='0.999999999|0.999999999|0.999999999|1.0.1|1.0.1|1.0.1|1.0.1|1.0.1|1.0.1|1.0.1|1.1',build='py27h47766b3_0|py36ha09b1f3_0|py27h5a33001_0|py27_0|py37_0|py_0|pyhd3eb1b0_0|py36_0|py_0|py36h047fa9f_0|py35h047fa9f_0|py35h79d4e7f_0'] |
@kevin-bates |
this is the message appearing when I want to run jupyter notebook(it's obvious it won't run but for understanding the error I think this will help you ) |
@anupsaha1 I'm not sure if this is related to the issue, but all I can see is pasting lots of non-CMD text into a CMD prompt.
This suggests you don't have pyzmq. You can try installing it:
|
thanks mate it's worked |
zeromq/pyzmq#1505 a few Jupyter users have encountered an issue where there program ends after this assert: Bad file descriptor (C:\ci\zeromq_1602704446950\work\src\epoll.cpp:100) We found this happens for users that have a windows 10 build that supports AF_Unix sockets but does not for those who have older windows 10 builds. this change is to remove the preserved errno (which doesn't appear to be used/checked anywhere-hence the later assert/abort) and instead after cleanup try to use a tcp/ip socket.
Late to the party but I encountered the same issue today with version 23.0.2 |
@malsesto had this same issue today, for me the solution was to rollback the Python version to |
@Godsix since you've been able to reproduce this in #1754 by building libzmq from source, can you build libzmq once each from commits zeromq/libzmq@b2921d7 and zeromq/libzmq@b77543a (both commits from https://github.com/zeromq/libzmq/pull/4422/commits) and report the result(s)? The first result should give an informative error, while the second hopefully actually fixes the issue. |
@minrk I am sorry to report that I have the same issue. Brand new computer, up to date Windows 11, Python 3.10.7, latest version of jupyter and all dependencies. I can't start a kernel in jupyter jupyter-lab, it crashes immediately with Bad address (C:\projects\libzmq\src\epoll.cpp:100) which does not exist. Processor 12th Gen Intel(R) Core(TM) i7-12700H 2.30 GHz Edition Windows 11 Pro |
@stfmnsl thanks for testing, and that's utterly baffling. How did you install pyzmq and which version of pyzmq did you get? Can you test the win_amd64 wheels for your Python from here: https://github.com/zeromq/pyzmq/actions/runs/3090754782 |
I did a default installation using pip, which downloaded the latest version pyzmq 24.0.1. Then I tried with 25.0.0b1. Same results. I went into debug to see what was happening:
Not sure that helps. I don't understand why the constructor gets to Bad Address. I will try the wheels you pointed out. |
Same results with the wheel (24.0.0 cp130) but the debug sequence is different: C:\Users\stephane.monsallier\fastai>python -m pdb test_zmq.py
|
I downloaded the latest version of libzmq (8d4f4efe) and compiled it. I manually replaced libzmq into pyzmq.lib. import zmq
ctx = zmq.Context()
pull = ctx.socket(zmq.PULL)
url = "tcp://127.0.0.1:5555"
pull.bind(url)
push = ctx.socket(zmq.PUSH)
push.connect(url)
push.send(b'test')
pull.recv()
push.close()
pull.close()
ctx.term() But I have different errors when trying to run jupyter: |
I wish to add here that for people who have issues logging in with Kernel of Jupyter Lab/Notebook, based on the simple advise of installing / downgrading, using the ANACONDA commands [For people with ANACONDA installed] conda install pytest pyzmq==19.0.2 This will fix the problem of non linking up with the Kernel! I basically looked through all advise online, and this one works for me! |
I wish to add another findings to this frustrating event of Jupyter Notebook (Python), not able to run in browsers (Chrome, EDGE, FireFox, etc) and in Visual Studio Code. [The stupid error codes, and not able to run Jupyter Notebook locally at Visual Studio Code] I found out that the real culprit is due to the VPN settings that most people will use. Next time when you find yourself facing this frustrating event perform the following steps.
This should be a permanent solution, but when the VPN starts to mess up the network settings, all you need to do is to perform the above command. [pyzmq is not the true culprit, I found out that I didn't actually install version 19.0.2 since my version of Python is 3.9 and above] |
The VPN issue sounds about right, I had a PC, freshly installed spyder on it. It works, but right after a VPN was installed, everything started failing, including fresh installations of vscode, new conda envs, non conda venvs, etc, it all traces back down to pyzmq and the epoll bad address issue. |
Building libzmq with the following configuration resolves the issue:
|
I have the same problem. After uninstalling VPN, it is ok. |
Just another confirmation of the same issue with Jupyter and "bad address" message. After looking all around without a proper solution and reading this thread, this was the only solution. The previous approach downgrading pyzmq was not possible and gave other errors. Precisely, I'm using a VPN, w11, conda 23.7.2 and typical python 3.10 and jupyter installation |
Glad to know that my days of frustration with this silly problem have helped many online! It took me a few days of reading online and researching on the problem, until I come across some nice bloke who posted the solution online in youtube. I tried the simple solution, and Jupyter started to work in all browsers.
I had actually reinstalled conda numerous times, and also tried with different versions of python, and nothing works... damn frustrating, then I came across this thread with the same error message, and I tried the pyzmq downgrade, it worked intermittently... the true cause of the problem is the VPN. |
Same issue here. Unfortunately any solution that involves rebooting is not an option since I am in a docker contained started by a CI pipeline. I am not able to stay on version 19.0.2 forever either. What other options are there? I don't even want to run
If nothing else helps then I could extract the Python code from the notebook and run it with standalone python, but any more straightforward ideas will be appreciated. (I am surprised such a simple operation as this has to involve |
executing any code from a notebook uses libzmq because it uses the Jupyter protocol to communicate with the kernel, which is a different process (can be a different language altogether), otherwise it wouldn't be a realistic execution of the notebook. If you want to export the notebook to a script before running it with a plain Python interpreter, that may be an option ( I think you might be hitting a quite different issue, though, as this is specifically about an unusual Windows-specific networking configuration issue, and I assume your CI pipeline in docker is not a Windows container? I'm not aware of any non-Windows users seeing issues like this, so more information (and a different Issue with repro steps) would be required. |
@minrk It is a windows docker (I also get it on physical windows machines). I make a miniconda environment listed below and in it run the notebook execution code mentioned in my last comment.
With |
ah, got it. Then it is the same issue. This is a libzmq bug that pyzmq can't do anything about, but there is a chance the brand new libzmq 4.3.5 build fixes it, if you want to try adding |
@minrk Thanks. I will try when |
There are now updated wheels with zeromq-4.3.5. If anyone who can still reproduce this issue can test the wheels available here and report back, that would be a huge help. pyzmq now has control over the cmake options of the libzmq it bundles in wheels, so there is some hope of resolving it if those wheels don't work yet. I'm sorry I've never been able to personally reproduce this issue, so I can't verify the fix myself! |
I installed the new wheel in an existing environment which is specified as in one of my previous comments but with The only new thing I have is this warning which is probably a different story (irrelevant for me):
and in one case (not deterministically reproducible) I got
but it seems the execution continued regardless and completed as success. I will keep you informed if anything should change after more thorough testing. Many thanks for looking into this and for your help! |
The proactor warning is not an issue, but could probably use some better communication (#1830) The signaler error is concerning. Do keep us updated on if that continues to be a problem. |
I read all the posts here and on stack overflow and I wasn't able to find a solution that works for me. I use Windows 10, Python 3.12.3 (installed via the app store). No VS Code or notebook whatever... I simply run my py script that communicates to my C++ code (running libzmq 4.3.5).
I tried to uninstall pyzmq and install an older version (tried different versions) but I wasn't able to do it. Every time I get the same error.
This is the end of the error logs:
All was working before with the older version of pyzmq. But now I can't even downgrade the version. Any advice people? |
@ademyankov I think you want pyzmq 25.12, not 25.0.2. 25.1.1 introduced support for Python 3.12. It is probably best to do
to get the latest pre-26 version, which will be 25.1.2. |
@minrk Ah, man! Thank you so much. It works like a charm! |
I think this is actually fixed in pyzmq 26.2, and possibly the root cause fixed upstream in zeromq/libzmq#4732 Only took me three and a half years to find a way to reproduce this! |
Hello, recently I set up a new python environment on a new computer as usual, I got automatically installed
pyzmq==21.0.2
, and I cannot use jupyter notebook, Jupyter lab, vs code at all, the python kernel crashes every time when I open a editor, and after one second, it directly crashes and lose connection to the kernel.This problem annoyed me for several weeks, and today I saw many people encountered this issue From December 2020 to January 2021. And I have never encountered this issue in the past.
Also, this error message is somewhat not useful and not making sense, finally I realized its pyzmq error.
I degraded it to
pyzmq==19.0.2
, it finally resolved this issue.I hope this could be fixed, or if you could push old versions of pyzmq for users to install as dependencies.
Thank you very much!
The text was updated successfully, but these errors were encountered: