iamtrask / Capsule

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
Apache License 2.0
33 stars 16 forks source link

ImportError: cannot import name 'client' #13

Closed sebasibarguen closed 6 years ago

sebasibarguen commented 6 years ago

Pulling the latest version and running the notebook as is, gives the following error:

ImportError: cannot import name 'client'

The full stack trace:

ImportError                               Traceback (most recent call last)
<ipython-input-1-4014c6f08f0c> in <module>()
----> 1 from capsule.zmq_client import LocalCapsuleClient
      2 import syft as sy

~/miniconda2/envs/py3/lib/python3.6/site-packages/capsule-0.1.0-py3.6.egg/capsule/__init__.py in <module>()
----> 1 from capsule import client
      2 from capsule import local_server

ImportError: cannot import name 'client'

This is just one issue, after changing from capsule import client to from capsule import tasks, there is still an issue inside local_server.py, which needs to import tasks from the capsule package like sofrom capsule import tasks.

There still appear to be other issues though.

sebasibarguen commented 6 years ago

After fixing the issues inside __init__.py and local_server.py, I am still getting the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Capsule/capsule/__init__.py", line 2, in <module>
    from capsule import local_server
  File "/Capsule/capsule/local_server.py", line 9, in <module>
    socket.bind('tcp://127.0.0.1:5001')
  File "zmq/backend/cython/socket.pyx", line 495, in zmq.backend.cython.socket.Socket.bind (zmq/backend/cython/socket.c:5653)
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:10014)
zmq.error.ZMQError: Address already in use

This seems to be happening because each time you import capsule it is running local_server.py. So if you run the sh build_and_run.sh and then try to import capsule there will be 2 instances of zmq trying to connect to the same port.