2
votes

I am writing a django (1.5) app for google app engine. When I run the app engine server (through pycharm) I get a django import error saying "No module named oauth2client.django_orm". I have installed and successfully worked with the google python api client before, so I know everything should work and is included in my python path to the best of my knowledge. Additionally if run the django console (through pycharm) and type in "import oauth2client" it works. So my only idea is that maybe the dev server doesn't have permissions to access the module? I am totally lost can anyone help plzzzz.

Here are the contents of the error page:

ImportError at /
No module named oauth2client.django_orm
Request Method: GET
Request URL:    <localhost>
Django Version: 1.5.8
Exception Type: ImportError
Exception Value:    
No module named oauth2client.django_orm
Exception Location: /Users/andrewschmitt/Projects/VMS/directory/models.py in <module>, line 3
Python Executable:  /usr/bin/python
Python Version: 2.7.6
Python Path:    
['/Users/andrewschmitt/Projects/VMS',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/protorpc-1.0',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.3',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webob-1.1.1',
 '/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/yaml-3.10']
Server time:    Tue, 28 Oct 2014 14:26:45 +0000

Here is the traceback:

Environment:


Request Method: GET
Request URL: <localhost>

Django Version: 1.5.8
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'foundation',
 'directory')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/handlers/base.py" in get_response
  101.                     resolver_match = resolver.resolve(request.path_info)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py" in resolve
  338.             for pattern in self.url_patterns:
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py" in url_patterns
  366.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py" in urlconf_module
  361.             self._urlconf_module = import_module(self.urlconf_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/Users/andrewschmitt/Projects/VMS/VMS/urls.py" in <module>
  5. admin.autodiscover()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/contrib/admin/__init__.py" in autodiscover
  29.             import_module('%s.admin' % app)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/contrib/auth/admin.py" in <module>
  179. admin.site.register(Group, GroupAdmin)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/contrib/admin/sites.py" in register
  98.                 validate(admin_class, model)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/contrib/admin/validation.py" in validate
  22.     models.get_apps()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/db/models/loading.py" in get_apps
  134.         self._populate()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/db/models/loading.py" in _populate
  75.                     self.load_app(app_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/db/models/loading.py" in load_app
  96.             models = import_module('.models', app_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/Users/andrewschmitt/Projects/VMS/directory/models.py" in <module>
  3. from oauth2client.django_orm import FlowField

Exception Type: ImportError at /
Exception Value: No module named oauth2client.django_orm

UPDATE: If I open up a terminal and start the app with the django's runserver (python manage.py runserver) the module loads fine. So there has to be a permissions issue of some sort either with Pycharm or Google's dev server (which is started via Pycharm).

2
it might be useful if you add the command that Pycharm is executing (the first line on the debug console) to your question. - Paul Collingwood

2 Answers

1
votes

check this link to verify if you properly configured everything well.

I think there is a problem of a missing module. Either it has not been imported or it is wrong spelled.

check this out

http://google-api-python-client.googlecode.com/hg/docs/epy/oauth2client.django_orm-pysrc.html

1
votes

You need to download the google api client for GAE google-python-api-client-gae-x.x.zip (https://code.google.com/p/google-api-python-client/downloads/list). Then unzip the folder and add each library you want to the root of your app engine project.