본문 바로가기
Programming/Google

[GAE] memcache Undefined variable error - python

by NAMP 2016. 7. 1.

[GAE] memcache Undefined variable error - python

from google.appengine.api import memcache
def get_from_memcache():
    value = memcache.get("key")

Undefined variable from import: get 에러 발생

Window → Preference 선택

PyDev → Interpreters → Python Interpreter 선택

Libraries → New Folder → Google App Engine 폴더 선택

Forced Builtins → New 선택, google.appengine.api.memcache 를 입력하고 OK

이후 이클립스를 종료하고 다시 실행한다.


출처

What fixed it for me was going to Preferences -> PyDev -> Interpreter – Python -> Libraries, clicking New Folder button and adding the google_appengine folder (the one where you have dev_appserver.py).

After clicking OK and closing Preferences I had to close the Eclipse and open it again.

PS: I had to leave the force build entry from Stack Overflow tip in my settings as well. When I removed it the error appeared again.


댓글