Thread: Python KeyError

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    0

    Python KeyError


    Dear Sirs,

    I would like to ask a question that may seem a little off-topic but since it is related to Python and I really cannot solve it - I thought to try to ask for some help here.

    I have installed OpenERP, an open source ERP software and then I installed an extension for connecting it to Magento. But when I configure it and try to connect them, I am getting and error that says:

    "File "/opt/openerp/v7/server/openerp/modules/registry.py", line 102, in __getitem__
    return self.models[model_name]
    KeyError: u'magento.instance'"

    This is the function in the registry.py file:

    "def __getitem__(self, model_name):
    """ Return a model for a given name or raise KeyError if it doesn't exist."""
    return self.models[model_name]
    "

    Any help is appreciated, thanks
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,961
    Rep Power
    481
    This could be a python version problem. Try again with python3.

    Otherwise maybe it's an installation problem. The function raised a KeyError because the model doesn't exist.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo