MSI installer
Git + Python + libzmq + pyzmq
- Install Python 2.7 from http://www.python.org/, and update path in System control panel to match installation directory, the installer does not do this automatically.
- Install Git for Windows (executable) from http://code.google.com/p/msysgit/. This does update the path if you ask for a Windows console install.
- Ensure your copy of Git is configured correctly, especially if you plan to commit to the repository:
C:\> git config --global user.name "Your full name"
C:\> git config --global user.email "your.email.registered@github"
- Open a console and test that git works.
- Create a working directory and clone the two public gits:
C:\> git clone git://github.com/zeromq/libzmq.git
C:\> git clone git://github.com/zeromq/pyzmq.git
- Ensure that you have matching branches of pyzmq and zeromq. For the lastest development branch, both should be master. If you would prefer more stable maintenance versions, checkout ZeroMQ maint and PyZMQ 2.0.x:
C:\> cd libzmq
C:\libzmq\> git checkout maint
C:\libzmq\> cd ../pyzmq
C:\pyzmq\> git checkout 2.0.x
- Open libzmq\builds\msvc\msvc.sln in Visual C++ and build the solution.1
- First, tell pyzmq where zeromq is:
$ python setup.py configure --zmq=../libzmq
configure is a new command, introduced in pyzmq-2.1.4. If you are building older pyzmq, locating libzmq takes a couple of steps:
- [pyzmq <= 2.1.1]: In order for Windows to be able to find the libzmq.dll you built, add the libzmq\lib directory to your PATH.
- [pyzmq <= 2.1.1]: create a file pyzmq\setup.cfg as follows:
[build_ext]
library_dirs = ..\libzmq\lib
include_dirs = ..\libzmq\include
replacing ..\libzmq with the path to your libzmq if it's not adjacent to pyzmq.
- Then run:
C:\pyzmq\> python setup.py build_ext --inplace
C:\pyzmq\> python setup.py test
C:\pyzmq\> python setup.py install
If you get errors for missing constants, such as:
error C2065: 'ZMQ_FD' : undeclared identifier
Then your ZeroMQ is probably too old for your PyZMQ.
Installing using MinGW
Steps are easy:
1. You need to install DevKit from rubyinstaller.org. Instructions for that are in RubyInstaller website wiki:
http://rubyinstaller.org/downloads
Note that this does *not* mean you are installing Ruby. The RubyInstaller project has created this nice little package for bundling MinGW tools, so it's smart to take advantage of it. The tools are 32-bit only so for now these instructions only describe how to install a 32-bit library.
2. Start a command prompt and invoke devkitvars.bat found inside the folder you installed DevKit, this will give you access to MinGW tools.
3. Download ØMQ source somewhere and extract (eg C:\src\zeromq).
4. Compile it using the following commands:
C:\> cd C:\src\zeromq
C:\> sh configure —prefix=C:/zeromq
C:\> make
C:\> make install
Note the use of forwardslash in the second command. The above commands will take a long time to complete, but once it's done, you will find inside C:\zeromq folder the binaries (bin, lib, include).
5) Copy the result binaries
Now you can copy the DLL from inside bin into a directory in your PATH and use it.
6) Don't forget the additional dependencies
Copy libstdc++-6.dll and libgcc_s_sjlj-1.dll from DevKit MinGW into the same folder you copied libzmq.dll.
To know where these DLLs are, you can use where, eg:
C:\> where libstdc++-6.dll
C:\Users\Luis\Tools\DevKit\4.5.1\mingw\bin\libstdc++-6.dll

I'm missing binarys for windows. It's not a good idea to install a c compiler to get a python module on windows.
The problem is not that much creating the binaries, rather, it's maintaining them. Would you like to become the maintainer?
Any chance of a ".msi" installer for windows for pyzeromq? Its really time consuming to compile it if one does not own visual C++ it seems. + I can't ask my users to compile and install it. Thanks for your kind consideration.
Noone have created msi installer so far. Would you like to give it a try?
I'm unable to build zeromq successfully using these directions. I'm on Windows 7 64-bit using msvc 2008, Python 2.7, and I did have to install Cython. If I follow the directions exactly, on the step "python setup.py build_ext —inplace" I get:
If I then first run vcvarsall I get:
If I then change setup.cfg to read:
I get:
And I'm stuck. What should I try next?
Jason,
Please report this problem at pyzmq bug tracker. Here it can be overlooked by pyzmq developers easily.
Martin
build\temp.win32-2.6\Release\_mysql.pyd.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
error: command ‘mt.exe’ failed with exit status 31
To fix this problem, go to C:\Python26\Lib\distutils, edit msvc9compiler.py, search for ‘MANIFESTFILE’, you will find the following line
ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
Then append the following line after the above line,
ld_args.append(‘/MANIFEST’)
Then go back to run “setup.py build”, it will succeed. Finally, run
setup.py install
I did this, I was having the same issue, hope it fixes your problem, I was able to compile afterwards
I just successfully built/installed on 32bit WinXP.
To do this, I did the following extra steps beyond what's detailed here:
I hope that helps someone.
Thanks,
Troy
What MSVC version? I tryed 10 and get many errors because of msvc9compiler.py (in distutils). After hardcoding version as 10.0, and commenting manifest file usage and removing extra_postopts, I do it successfully (Windows Vista), but it's "dirty hacks"… So, it's very interesting to me how to do it with MSVC 10 under Vista
I was using MSVC09 (Visual Studio 2008).
Anyone have any insight towards DEPLOYING pyzmq on windows without building it on the box you're going to use it on? I can't get this to work. I keep getting DLL load failed errors, but I don't know what DLL it's trying to load, or where it expects it to be. I've added everything in the world to my path, and placed copies of libzmq.dll all over the place… :)
No luck.
Thanks,
Troy
You can use "dependency walker" to find out what libraries are not found.
You can find a binaries of ZMQ for Windows here: http://mark.ossdl.de/zmq-win - The zipfiles for Python contain the DLL and LIB.
Drop me a line if you need other versions.
I did two other things in addition to the steps above to successfully build pyzmq 2.1.1 with zeromq 2.1.2 as a 32-bit extension on Windows 7 64-bit edition with MSVC 2008:
- When building run a "Visual Studio 2008 Command Prompt"; this runs vcvarsall.bat for you, and is standard practice when building Python modules on Windows.
- Like troy I copied libzmq.dll into ./zmq/core/; you don't need to put the DLL file into the system path, but of course putting the DLL into the system path should work as well.
@Troy RE: deploying pyzmq on other Windows boxes. Keep in mind that you need all the other DLL files that a Microsoft Visual Studio installation brings with you, besides
just libzmq.dll. If you don't have MSVC installed on a new Windows box you will not have these prerequisite DLLs.
As a first step you need to look for an appropriate "Microsoft Runtimes Redistributable" package. For example, here is the redist package for MSVC 2010: http://tinyurl.com/33375zn
If this doesn't work, make sure there are no other instances of DLLs on your Windows box that could conflict with pyzmq. This is much harder than it sounds, and is an instance of "Windows DLL Hell", because you need to check both the memory space and the system path for conflicting DLLs.
HTH.
Need help here. I installed the following:
- python 3.2 (python-3.2.msi from python.org)
- pyzmq-2.1.4.win32-py3.2.msi (from https://github.com/zeromq/pyzmq/downloads).
Tried python in dos box and when I do "import zmq", I get this:
=============== paste ======================
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\gopalagrawal>python
Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
Traceback (most recent call last):
File “”, line 1, in
File “D:\Python32\lib\site-packages\zmq\init.py”, line 30, in
ctypes.cdll.LoadLibrary(os.path.join(here, ‘libzmq.dll’))
File “D:\Python32\lib\ctypes\init.py”, line 418, in LoadLibrary
return self._dlltype(name)
File “D:\Python32\lib\ctypes\init.py”, line 340, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 14001] This application has failed to start because the application configurati
on is incorrect. Reinstalling the application may fix this problem
=============== end paste====================
I went to the pyzmq site where it says “To build and install this Python package, you will first need to build and install the latest development version of 0MQ itself.”. But it is not clear if I need to do this on windows machine as well with the msi version - there is already a libzmq.dll in my D:\Python32\Lib\site-packages\zmq folder.
What am I missing ?
Just an update … ok, so I finally downloaded the zmq2.1.4.zip file and got hold of a MSVS Express C++ 2008. Built the solution and found the libzmq.dll file in the lib folder. Substituted this dll for the dll that comes by default with the pyzmq2.14. Now I am able to 'import zmq' successfully.
Still coming to grips about the fact that everything in python3.2 is unicode and need to use send_unicode or recv_unicode for everything (aarrgh,.. hate unicode stuff).
Just pulled PyZMQ and ZeroMQ-2.1.7 from git, side-by-side on my E:\ drive. Using gitbash, python setup.py configure—zmq=../libzmq fails, complaining it can't find libzmq.lib.
So I found libzmq.lib (in ../libzmq/builds/Release/libzmq.*) and copied the files from there to ../libzmq/lib.
unresolved external symbol __imp_zmq_version referenced in function main.
Note: Win 7 64, VS 2010.
AGGH! THERE IS AN MSI ON THE GITHUB DOWNLOADS PAGE! YOU RASCALS!
*Please* update these pages to reflect the presence of a pyzmq msi installer on the github page to … I've just spent 2 hours failing to get pyzmq to build under windows (as opposed to the magic that happens under linux :)… Please save the next guy :)
Hi everyone!
I'm having a problem with installing 3.0 zeromq on Windows. I've done all of the steps above but when I try to compile helloworld server or client it gives:
fatal error: zmq.h: No such file or directory
compilation terminated.
I've tried to compile it using: gcc -o HelloWorldclient.exe HelloWorldclient.c -Wall -lzmq
libzmq.dll, libgcc_s_sjlj-1 and libstdc++-6 are all in a place pointed to by PATH
I'm still new to this programming thing so any help would be appreciated!
Love
hi,
i want to install on windows.. i dont have visual studio with me. I am a java guy and was wondering if we have some exe or some thing that can install this in one shot!
The way zeromq works is very brilliant .. why is the installation made soooo complex??? It seems like it would take 1 hr to pickup the concepts and 1 day to install… !!!
There are some packages for Windows here:
http://miru.hk/archive/ZeroMQ-2.1.10-win32.exe
http://miru.hk/archive/ZeroMQ-2.1.10-win64.exe
http://miru.hk/archive/ZeroMQ-3.0.2-beta-win32.exe
http://miru.hk/archive/ZeroMQ-3.0.2-beta-win64.exe
Win32 = Windows XP 32-bit + SDK 7.1
Win64 = Windows 7 64-bit + SDK 7.1
Portfolio
This did not install the java binding on windows for me. For example jzmq.dll is not installed.
Is there an easy way to install the java binding on 32 bit windows?
THanks
S
Hi,
I fully agree with you. Grasping the concepts didn't take much time, but it is too demanding on the installation efforts.