Hi bokubob,
I know this is a very old post, but do you have any solution to make numpy
array work with rpyc? I encounter similar issue recently.
Thank you and best regards!
Shuang
On Saturday, March 20, 2010 at 11:08:18 AM UTC+8, bokubob wrote:
>
> Hello,
>
> Does anyone use rpyc with numpy arrays? I'm having some strange
> behavior, but I'm just starting with rpyc, so I don't really know
> where to start.
>
> Here's an example:
>
> Python 2.6.4 (r264:75706, Mar 5 2010, 22:31:14)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import numpy
> >>> import rpyc
> >>> c = rpyc.classic.connect("localhost")
> >>> a = numpy.array([1,2,3])
> >>> type(a)
> <type 'numpy.ndarray'>
> >>> c.modules.numpy.max(a)
> 3
> >>> c.modules.numpy.array([1,2,3])
> array([1, 2, 3])
> >>> c.modules.numpy.array(a)
> ======= Remote traceback =======
> Traceback (most recent call last):
> File "/home/jeisch/scripts/python/rpyc/core/protocol.py", line 234,
> in _dispatch_request
> res = self._HANDLERS[handler](self, *args)
> File "/home/jeisch/scripts/python/rpyc/core/protocol.py", line 447,
> in _handle_call
> **dict(kwargs))
> ValueError: invalid __array_struct__
>
> ======= Local exception ========
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/home/jeisch/scripts/python/rpyc/core/netref.py", line 123, in
> __call__
> return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
> File "/home/jeisch/scripts/python/rpyc/core/netref.py", line 45, in
> syncreq
> return conn().sync_request(handler, oid, *args)
> File "/home/jeisch/scripts/python/rpyc/core/protocol.py", line 353,
> in sync_request
> raise obj
> ValueError: invalid __array_struct__
> >>>
>
> I'm using rpyc 3.0.7, python 2.6.4, numpy 1.3.0.
>
> I don't need to do this exact operation, but the operations I do want
> to use (involving matplotlib) run into this exact same error.
>
> Thanks,
> -Jonathan
>
>
--
---
You received this message because you are subscribed to the Google Groups
"rpyc" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.