Search code examples
pythoninstallationanacondazeromq

Install ZeroMQ with enable-drafts using conda


I installed pyzmq with conda and libzmq5-dev (using apt). When I use zmq.SERVER (also tried zmq.DISH, zmq.RADIO):

context = zmq.Context()
socket = context.socket(zmq.SERVER)

get error:

socket = context.socket(zmq.SERVER) AttributeError: module 'zmq' has no attribute 'SERVER'

I know this is an error due to a disabled draft, but I don't know how to install pyzmq using conda with enable-draft , because all tutorials say use pip install pyzmq --install-option=--enable-drafts (like this)

Or maybe I can enable pyzmq draft in Anaconda?


Solution

  • Neither the Anaconda nor the Conda Forge builds include that flag during build. Simplest solution would be just to use pip. For stability reasons, I wouldn't do this in the base environment. Instead, create a new environment with Python and pip installed (plus whatever else you expect to need), activate the environment, then run that pip command from within the environment.

    More long term, if you have a solid argument for the flag being included by default, then you could try posting an Issue or creating a Pull Request on one or both of the feedstocks.