[zeromq-dev] building python bindings on Windows

Brian Granger ellisonbg at gmail.com
Sun Aug 29 00:49:03 CEST 2010


I have updated the README with this information:

http://github.com/zeromq/pyzmq/commit/42a1472889ce25405b38919f0588ad3dbca0ab5f

Please let me know if you find anything else on Windows.

Cheers,

Brian

On Tue, Jun 29, 2010 at 7:41 AM, Brian Granger <ellisonbg at gmail.com> wrote:
> Chris,
>
> On Sun, Jun 27, 2010 at 2:28 PM, Chris Trimble <trimbo at gmail.com> wrote:
>> As a quick test, try dumping libzmq.dll into the same directory as your
>> Python executable and see if that works.  I bet it will.
>
> Yes, I recall that I did things like that to get it to work on Windows.
>
>> Generally you'll need to add the location of libzmq.dll to your PATH.  The
>> reason this will work next to the executable is because Windows searches
>> that directory, then PATH directories, for dlls -- it will NOT search the
>> location of your sys.path.  Same behavior as LD_LIBRARY_PATH on Linux.
>>  Here's MS's docs:
>>  http://msdn.microsoft.com/en-us/library/7d83bc18(VS.80).aspx
>
> Thanks for the background and link.  I will update the docs with this info.
>
>> BTW, you shouldn't need to compile pyzmq with mingw.  Setup.py will work in
>> a Visual studio 2008 shell just fine.
>
> Definitely!
>
> Cheers,
>
> Brian
>
>>  - Chris
>>
>> On Sat, Jun 26, 2010 at 9:16 AM, Brad Reisfeld <brad.reisfeld at gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> Brian Granger suggested that I contact the list about the following.
>>>
>>> I am interested in compiling and using py0mq on Windows XP.
>>>
>>> I followed the straightforward directions at
>>> http://www.zeromq.org/bindings:python#toc6
>>>
>>> In particular, I used MS Visual Studio 2008 to build libzmq.dll .
>>> I then edited the python setup.cfg to point to the appropriate
>>> directories and built and installed the pyzmq package using the
>>> mingw32-gcc compiler.
>>>
>>> Everything looks fine and I now have a zmq directory in
>>> python's site-packages directory with three items:
>>> __init__.py
>>> _zmq.pyd
>>> tests (directory)
>>>
>>> However, when I try to import the package, I get
>>>
>>> =====
>>>
>>> >>> import zmq
>>> Traceback (most recent call last):
>>>  File "<stdin>", line 1, in <module>
>>>  File "D:\Python26\lib\site-packages\zmq\__init__.py", line 26, in
>>> <module>
>>>   from zmq import _zmq
>>> ImportError: DLL load failed: The specified module could not be found.
>>>
>>> =====
>>>
>>> I have confirmed that the zmq directory is in my sys.path.
>>>
>>> I have tried this in both Python 2.5.4 and Python 2.6.5
>>>
>>> Do you have any idea what could be wrong?
>>>
>>> Could there be an issue with me compiling the zmq.dll with Visual
>>> studio and then creating the python extension with the mingw32-gcc
>>> compiler? (Although when I try 'python setup.py build
>>> --compiler=msvc', I get an error 'Python was built with Visual
>>> Studio 2003; extensions must be built with a compiler than can
>>> generate compatible binaries.')
>>>
>>> Thank you for your help.
>>>
>>> Best Regards,
>>> Brad
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
>
>
>
> --
> Brian E. Granger, Ph.D.
> Assistant Professor of Physics
> Cal Poly State University, San Luis Obispo
> bgranger at calpoly.edu
> ellisonbg at gmail.com
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the zeromq-dev mailing list