[IPython-dev] pyzmq problems

Brian Granger ellisonbg at gmail.com
Mon May 24 14:49:11 EDT 2010


Omar,

I am busy today but here are some ideas:

* To get to know pyzmq better, I would open up 2-3 IPython sessions,
import zmq on all of them and then start to create sockets and send
messages between the different IPython sessions.  This works really
well and will give you a better idea of how the different socket types
work, how the json stuff works, etc.  This would be invaluable.

* To simplify debugging, create a version of the code that has the
absolute minimal code - no objects, config, etc.  Just the raw zmq
messaging stuff.

I think if you do these 2 things, the error will be more obvious.
Keep posting back to the list so I or Fernando can help with this
though.

Cheers,

Brian

2010/5/22 Omar Andrés Zapata Mesa <andresete.chaos at gmail.com>:
> hi all
> I am working yet in zmq module to ipython, but I have the next problem using
> json.
> the code are in http://github.com/omazapa/ipython
> into the dir  ipython/IPython/core/
>
> I run my zmq server prototype
>
> the output is
>
> omazapa at tuxhome:~/MyProjects/GSoC/tmp/ipython/IPython/core$ python
> ipzmq_server.py
> reply socket= tcp://127.0.0.1:5555
> publisher socket = tcp://127.0.0.1:5556
> Server started.
>
>
> in this moment I am waiting json`s message in reply socket.
>
>
> then I run my client prototype
>
> the output is
>
> omazapa at tuxhome:~/MyProjects/GSoC/tmp/ipython/IPython/core$ python
> ipzmq_client.py
> request socket = tcp://127.0.0.1:5556
> subscribe socket = tcp://127.0.0.1:5555
>
>
> but server no recieve the message.
>
> the output is
>
> Traceback (most recent call last):
>   File "ipzmq_server.py", line 112, in <module>
>     msg=server.recieve_reply()
>   File "ipzmq_server.py", line 79, in recieve_reply
>     msg=self._reply_socket.recv_json()
>   File "_zmq.pyx", line 709, in zmq._zmq.Socket.recv_json (zmq/_zmq.c:5242)
>   File "/usr/lib/python2.6/json/__init__.py", line 307, in loads
>     return _default_decoder.decode(s)
>   File "/usr/lib/python2.6/json/decoder.py", line 319, in decode
>     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>   File "/usr/lib/python2.6/json/decoder.py", line 338, in raw_decode
>     raise ValueError("No JSON object could be decoded")
> ValueError: No JSON object could be decoded
>
>
> have you some idea?
> maybe, do I need encode my message before send it?
> I have the last version of zeromq2 from official repo and pyzmq
> http://github.com/ellisonbg/pyzmq/, I am using python2.6
>
> Brian  said me that the problem is that I have outdated version of zeromq
> and pyzmq but I update zeromq and pyzmq and It is not working yet.
>
>
> thks
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-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



More information about the IPython-dev mailing list