1. 程式人生 > >python rpyc 報錯: AttributeError: cannot access 'new'

python rpyc 報錯: AttributeError: cannot access 'new'

conn dispatch file proxy client 報錯 pre cor lib

Error msg:

Traceback (most recent call last):
  File "/home/hpcm/Desktop/test/install/client.py", line 9, in <module>
    print(s_obj.root.new())
  File "/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/netref.py", line 159, in __getattr__
    return syncreq(self, consts.HANDLE_GETATTR, name)
  File 
"/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/netref.py", line 75, in syncreq return conn.sync_request(handler, proxy, *args) File "/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 471, in sync_request return self.async_request(handler, *args, timeout=timeout).value File
"/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/async_.py", line 97, in value raise self._obj AttributeError: cannot access new ========= Remote Traceback (1) ========= Traceback (most recent call last): File "/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 329, in _dispatch_request res
= self._HANDLERS[handler](self, *args) File "/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 596, in _handle_getattr return self._access_attr(obj, name, (), "_rpyc_getattr", "allow_getattr", getattr) File "/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 538, in _access_attr name = self._check_attr(obj, name, param) File "/home/hpcm/.local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 523, in _check_attr raise AttributeError("cannot access %r" % (name,)) AttributeError: cannot access new

錯誤原因:

服務端和客戶端rpyc版本不一致, 會導致connect能成功, 但是不能調用方法
解決方法:

  使用相同版本的rpyc

python rpyc 報錯: AttributeError: cannot access 'new'