zeromq / pyzmq

PyZMQ: Python bindings for zeromq
http://zguide.zeromq.org/py:all
BSD 3-Clause "New" or "Revised" License
3.66k stars 638 forks source link

Why does the wheel package on pypi not support IPC on windows 10? #1886

Closed needones closed 1 year ago

needones commented 1 year ago

What pyzmq version?

25.1.0

What libzmq version?

4.3.4

Python version (and how it was installed)

3.9.17

OS

Windows10

What happened?

I used the pyzmq installation package on the pypi platform, which when I used ipc communication mode prompted me: "zmq.error.ZMQError: Protocol not supported (addr='ipc:///tmp_stream')".

However, I use the source code on github, and use the command "python setup.py bdist_wheel" to package and install it, and I can use IPC communication normally on windows.

I don't understand why this is happening.

Code to reproduce bug

import zmq
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind('ipc:///tmp_stream')

Traceback, if applicable

Traceback (most recent call last):
  File "D:\project\pyqcat-courier\test\test_ipc1.py", line 4, in <module>
    socket.bind('ipc:///tmp_stream')
  File "D:\tools\miniconda3\envs\courier\lib\site-packages\zmq\sugar\socket.py", line 302, in bind
    super().bind(addr)
  File "zmq\backend\cython\socket.pyx", line 564, in zmq.backend.cython.socket.Socket.bind
  File "zmq\backend\cython\checkrc.pxd", line 28, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Protocol not supported (addr='ipc:///tmp_stream')

More info

No response

minrk commented 1 year ago

libzmq only has IPC support when built against certain MSVC targets. There appear to be various problems in libzmq's Windows IPC support that cause crashes for folks who don't use IPC in some weird situations I still don't fully understand, so I had to pull it out by picking a Windows build with earlier MSVC, pending a fixed release of libzmq. I think I can try adding it back when there's a libzmq 4.3.5.

needones commented 1 year ago

Thanks for your answer, which eliminated my curiosity. I hope pyzmq can better support ipc on the windows platform in the future, because the port communication is limited, the maintenance is troublesome, and the multi-process development of python is not very friendly.