I am trying to setup django-nonrel on GAE (Google App Engine) - following the steps here http://www.allbuttonspressed.com/projects/djangoappengine#installation

The test application works great -

I was able to use the cache API in the application, but not so for the tests and shell:

Attempting to from django.core.cache import cache in the shell gives me:

>>> from django.core.cache import cache
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "django-testapp/django/core/cache/__init__.py", line 182, in <module>
    cache = get_cache(DEFAULT_CACHE_ALIAS)
  File "django-testapp/django/core/cache/__init__.py", line 180, in get_cache
    return backend_cls(location, params)
  File "django-testapp/django/core/cache/backends/memcached.py", line 154, in __init__
    import memcache
ImportError: No module named memcache

Similarly attempting ./manage.py test fails the same way.

Any idea why ./manage runserver works fine, but ./manage shell or ./manage test fails to import cache?

up vote 41 down vote accepted

I had the same problem when I upgraded to Google App Engine 1.6.0 from 1.5.5 .

I solved the problem by installing python-memcached:

pip install python-memcached
  • I had this problem trying to runserver on OSX and it worked for me. Thanks! – Brendan Nov 27 '13 at 3:16

I alse do like this:

sudo pip install python-memcached

then restart the django, it works.

For gentoo users it's recommended:
emerge -av dev-python/python-memcached

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.