ImportError: cannot import name __version__

Bug #1262048 reported by Daniel Blanco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openerp-google-api
New
Undecided
Unassigned

Bug Description

Openerp 7.

Installed the following dependencies:

pip install --upgrade google-api-python-client
pip install apiclient
pip install oauth2client
pip install uritemplate
pip install argparse
pip install urllib3

Get the error when trying to insntall

OpenERP Server Error
Client Traceback (most recent call last):
  File "/opt/bma/openerp7/openerp/openerp/addons/web/http.py", line 204, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/bma/openerp7/openerp/openerp/addons/web/controllers/main.py", line 1132, in call_button
    action = self._call_kw(req, model, method, args, {})
  File "/opt/bma/openerp7/openerp/openerp/addons/web/controllers/main.py", line 1120, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/bma/openerp7/openerp/openerp/addons/web/session.py", line 42, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/bma/openerp7/openerp/openerp/addons/web/session.py", line 30, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/bma/openerp7/openerp/openerp/addons/web/session.py", line 103, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/bma/openerp7/openerp/openerp/addons/web/session.py", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/bma/openerp7/openerp/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/bma/openerp7/openerp/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/bma/openerp7/openerp/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/bma/openerp7/openerp/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/bma/openerp7/openerp/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/bma/openerp7/openerp/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/bma/openerp7/openerp/openerp/addons/base/module/module.py", line 706, in install_from_urls
    self.update_list(cr, uid, context=context)
  File "/opt/bma/openerp7/openerp/openerp/addons/base/module/module.py", line 617, in update_list
    handler.load_addons()
  File "/opt/bma/openerp7/openerp/openerp/addons/web/http.py", line 580, in load_addons
    m = __import__('openerp.addons.' + module)
  File "/opt/bma/openerp7/openerp/openerp/modules/module.py", line 133, in load_module
    mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
  File "/opt/bma/openerp7/openerp/openerp/addons/google_api/__init__.py", line 26, in <module>
    import google_calendar
  File "/opt/bma/openerp7/openerp/openerp/addons/google_api/google_calendar.py", line 28, in <module>
    from apiclient import discovery
  File "/usr/local/lib/python2.6/dist-packages/apiclient/discovery.py", line 58, in <module>
    from apiclient.http import HttpRequest
  File "/usr/local/lib/python2.6/dist-packages/apiclient/http.py", line 50, in <module>
    from model import JsonModel
  File "/usr/local/lib/python2.6/dist-packages/apiclient/model.py", line 30, in <module>
    from apiclient import __version__
ImportError: cannot import name __version__

Revision history for this message
Gustavo Lindenberg (gus-5) wrote :

Hey,
I know this is old, but it seems that it's a Google's API problem

As stated here: http://xmodulo.com/2013/12/integrate-google-calendar-linux-desktop.html#comment-5370

I did:

The fix is, as you mention, to edit 'apiclient/model.py'
Change
from apiclient import __version__
to
from mimeparse import __version__

The file can be on /usr/local/lib/python2.7/dist-packages/apiclient/model.py

In my case it was on /usr/lib/python2.6/site-packages/apiclient

and it worked.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.