title: Eclipse+PyDev+GAE memcache "Undefined variable from import: get"
body: <p>I've started using Eclipe+PyDev as an environment for developing my first app for Google App Engine. Eclipse is configured according to <a href="http://code.google.com/appengine/articles/eclipse.html" rel="nofollow noreferrer">this tutorial</a>.</p>
  
  <p>Everything was working until I start to use memcache. PyDev reports the errors and I don't know how to fix it:</p>
  
  <p><img src="https://web.archive.org/web/20140313064839/http://www.freeimagehosting.net/uploads/fc176c0957.png" alt="alt text"></p>
  
  <p>Error: Undefined variable from import: get</p>
  
  <p>How to fix this?
  Sure, it is only PyDev checker problem. Code is correct and run on GAE.</p>
  
  <p>UPDATE:</p>
  
  <ol>
  <li>I'm using PyDev 1.5.0 but experienced the same with 1.4.8.</li>
  <li>My PYTHONPATH includes (set in Project Properties/PyDev - PYTHONPATH):
  
  <ul>
  <li><code>C:\Program Files\Google\google_appengine</code></li>
  <li><code>C:\Program Files\Google\google_appengine\lib\django</code></li>
  <li><code>C:\Program Files\Google\google_appengine\lib\webob</code></li>
  <li><code>C:\Program Files\Google\google_appengine\lib\yaml\lib</code></li>
  </ul></li>
  </ol>
  
  <p>UPDATE 2:</p>
  
  <p>I took a look at <code>C:\Program Files\Google\google_appengine\google\appengine\api\memcache\__init__.py</code> and found <code>get()</code> is not declared as <code>memcache</code> module function. They use the following trick to do that (I didn't hear about such possibility):</p>
  
  <pre><code>_CLIENT = None
  
  
  def setup_client(client_obj):
    """Sets the Client object instance to use for all module-level methods.
  
    Use this method if you want to have customer persistent_id() or
    persistent_load() functions associated with your client.
  
    Args:
      client_obj: Instance of the memcache.Client object.
    """
    global _CLIENT
    var_dict = globals()
  
    _CLIENT = client_obj
    var_dict['set_servers'] = _CLIENT.set_servers
    var_dict['disconnect_all'] = _CLIENT.disconnect_all
    var_dict['forget_dead_hosts'] = _CLIENT.forget_dead_hosts
    var_dict['debuglog'] = _CLIENT.debuglog
    var_dict['get'] = _CLIENT.get
    var_dict['get_multi'] = _CLIENT.get_multi
    var_dict['set'] = _CLIENT.set
    var_dict['set_multi'] = _CLIENT.set_multi
    var_dict['add'] = _CLIENT.add
    var_dict['add_multi'] = _CLIENT.add_multi
    var_dict['replace'] = _CLIENT.replace
    var_dict['replace_multi'] = _CLIENT.replace_multi
    var_dict['delete'] = _CLIENT.delete
    var_dict['delete_multi'] = _CLIENT.delete_multi
    var_dict['incr'] = _CLIENT.incr
    var_dict['decr'] = _CLIENT.decr
    var_dict['flush_all'] = _CLIENT.flush_all
    var_dict['get_stats'] = _CLIENT.get_stats
  
  
  setup_client(Client())
  </code></pre>
  
  <p>Hmm... Any idea how to force PyDev to recognize that?</p>