0

After I pulled dynamic-dynamodb via git and made my changes to example-dynamic-dynamodb.conf and install the requirements.txt, I am trying to run/start dynamic-dynamodb

I am running on AWS EC2

  • OS: ubuntu 14.04
  • python --version Python 2.6.9
  • pip --version pip 7.1.2 from /usr/local/lib/python2.6/site-packages (python 2.6)

$>cd dynamic-dynamodb

    $>ls
    build  cloudformation-templates  dist  docs  dynamic_dynamodb  dynamic-dynamodb  dynamic_dynamodb.egg-info  example-dynamic-dynamodb.conf  LICENSE  Makefile  MANIFEST  MANIFEST.in  README  README.md  requirements.txt  setup.py

    $>./dynamic-dynamodb start

Traceback (most recent call last):
   File "./dynamic-dynamodb", line 22, in <module>
    import dynamic_dynamodb
  File "/root/dynamic-dynamodb/dynamic_dynamodb/__init__.py", line 29, in <module>
    from dynamic_dynamodb.aws import dynamodb
  File "/root/dynamic-dynamodb/dynamic_dynamodb/aws/dynamodb.py", line 12, in <module>
    from dynamic_dynamodb.log_handler import LOGGER as logger
  File "/root/dynamic-dynamodb/dynamic_dynamodb/log_handler.py", line 26, in <module>
    import config_handler
  File "/root/dynamic-dynamodb/dynamic_dynamodb/config_handler.py", line 5, in <module>
    CONFIGURATION = config.get_configuration()
  File "/root/dynamic-dynamodb/dynamic_dynamodb/config/__init__.py", line 155, in get_configuration
    'tables': ordereddict()
TypeError: 'module' object is not callable

Is this the right way to start dynamic-dynamodb service? Dose any one have an advice?

2 Answers 2

1

This looks like a bug in dynamic-dynamodb.

In dynamic_dynamodb/config/config_file_parser.py and dynamic_dynamodb/config/__init__.py, there is code like:

try:
    from collections import OrderedDict as ordereddict
except ImportError:
    import ordereddict

ImportError is caught when you're using a version lower than 2.7, and collections.OrderedDict doesn't exist. But doing just import ordereddict seems like a logical error; you want ordereddict to point to the OrderedDict class, not the module that contains the OrderedDict class.

First, I suggest upgrading to 2.7 or higher, where this is no longer a problem.

Second, If you can't do that, I suggest changing the lines in both of those files to

try:
    from collections import OrderedDict as ordereddict
except ImportError:
    from ordereddict import OrderedDict as ordereddict

Third, if that doesn't work, I suggest filing a bug on the github page, and hopefully the author will issue a fix. (actually, you should probably do this regardless of whether the previous two approaches succeed)

Sign up to request clarification or add additional context in comments.

1 Comment

Changing the lines in both of those files to try: from collections import OrderedDict as ordereddict except ImportError: from ordereddict import OrderedDict as ordereddict fixed the problem, Thanks. Yeah i will because its the 2nd bug i find but not able to fix :) have a nice day
0

I had the same issue, it looks like this is all due to the current t1.micro instance does not come updated with Python 2.7, and pip cannot install dynamic-dynamodb package without it. So I tried to update all in sequence and it worked for me, I have tried a couple times and missing any of these steps or out of order would not work.

sudo yum update
sudo update-alternatives --set python /usr/bin/python2.7
sudo easy_install pip
sudo /usr/local/bin/pip install -U dynamic-dynamodb

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.