Acreo / DoubleDecker

Hierarchical messaging system
http://acreo.github.io/DoubleDecker/
GNU Lesser General Public License v2.1
3 stars 2 forks source link

ImportError: No module named orchestrator_core.doubledecker #16

Closed developer-cs closed 7 years ago

developer-cs commented 7 years ago

I am trying to install Double Decker Python version; client only. I follow the following steps : $ git clone https://github.com/Acreo/DoubleDecker.git $ cd DoubleDecker $ git checkout 93ffede $ cd python $ sudo apt-get install build-essential python3-dev python3-setuptools python3-pip libffi-dev $ git clone https://github.com/pyca/pynacl $ cd pynacl $ sudo python3.4 setup.py install $ sudo apt-get install python3-zmq $ cd .. $ sudo python3.4 setup.py install

After installations when I run the code I got the following error

Traceback (most recent call last): File "/home/developer/ orchestrator/ orchestrator_core/dd_server.py", line 2, in from .doubledecker.clientSafe import ClientSafe ImportError: No module named 'orchestrator_core.doubledecker'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker worker.init_process() File "/usr/local/lib/python3.4/dist-packages/gunicorn/workers/base.py", line 126, in init_process self.load_wsgi() File "/usr/local/lib/python3.4/dist-packages/gunicorn/workers/base.py", line 136, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/local/lib/python3.4/dist-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.4/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python3.4/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.4/dist-packages/gunicorn/util.py", line 357, in import_app import(module) File "/home/developer/orchestrator/main.py", line 14, in from orchestrator_core.dd_server import DD_Server File "/home/developer/orchestrator/orchestrator_core/dd_server.py", line 4, in from doubledecker.clientSafe import ClientSafe File "/usr/local/lib/python3.4/dist-packages/doubledecker-0.3-py3.4.egg/doubledecker/clientSafe.py", line 9, in import nacl.utils File "/usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/utils.py", line 19, in import nacl.bindings File "/usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/init.py", line 17, in from nacl.bindings.crypto_box import ( File "/usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_box.py", line 19, in from nacl.utils import ensure ImportError: cannot import name 'ensure'

I also try …. But I got the same error

import doubledecker Traceback (most recent call last): File "", line 1, in ImportError: No module named doubledecker

I am using ubuntu 14.04

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty

These are the Pynacl installations records

/usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/native_libs.txt /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/SOURCES.txt /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/top_level.txt /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/PKG-INFO /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/not-zip-safe /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/requires.txt /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/EGG-INFO/dependency_links.txt /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/init.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/public.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/signing.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/secret.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/_sodium.cpython-34m.so /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/_sodium.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/exceptions.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/hash.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/encoding.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/utils.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_secretbox.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/randombytes.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/init.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/sodium_core.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_sign.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_shorthash.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_box.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_hash.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/crypto_scalarmult.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/utils.py /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/crypto_scalarmult.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/crypto_box.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/utils.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/init.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/sodium_core.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/crypto_sign.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/crypto_secretbox.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/crypto_hash.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/randombytes.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/bindings/pycache/crypto_shorthash.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/signing.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/utils.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/exceptions.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/init.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/encoding.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/secret.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/hash.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/public.cpython-34.pyc /usr/local/lib/python3.4/dist-packages/PyNaCl-1.1.0.dev1-py3.4-linux-x86_64.egg/nacl/pycache/_sodium.cpython-34.pyc

These are the Python installations records

/usr/local/lib/python3.4/dist-packages/doubledecker-0.3-py3.4.egg /usr/local/bin/ddclient.py /usr/local/bin/ddkeys.py /usr/local/bin/ddbroker.py

I install DoubleDecker client in python, 10 days before using Ubuntu 14.4 but I didn't get this error. I am looking forward for your kind response. Thanks!

eponsko commented 7 years ago

Hi! It seems you are using a quite old version of the DoubleDecker python library, basically from a year ago or so. At that point there was a single repository with C, Python, and Java clients. Since then we have separated the different languages into different repositories, https://github.com/Acreo/DoubleDecker-py for the python version. It seems the root of your issues is the "ImportError: cannot import name 'ensure'" line, it seems the PyNaCl-1.1.0.dev1 version does not have the expected module.

Without having the rest of the code and system here to debug (I guess it's the un-orchestrator from polito?), it's a bit difficult to diagnose. Using the latest version of the python library in a clean ubuntu 14.04 docker, this seemed to work for me:

$ docker run -it --rm ubuntu:14.04
# apt-get update
# apt-get install git-core python3-setuptools build-essential libpython3-dev libffi-dev python3-cffi
# git clone https://github.com/Acreo/DoubleDecker-py.git
# cd DoubleDecker-py/
# python3 setup.py install
# python3
 >> from doubledecker import clientSafe
 >> 

Perhaps this approach works better? Then you also get a fresher version of the client, with bugfixes etc. Cheers, Pontus

eponsko commented 7 years ago

An alternative installation method is the one used in the Travis script (https://github.com/Acreo/DoubleDecker-py/blob/master/.travis.yml)

$ pip install -r requirements.txt
$ python3 setup.py install

However, I'm not sure which ubuntu versions are used by Travis to compile and test..

developer-cs commented 7 years ago

Thanks, the problem was in pynacl