title: Cannot get gcloud to work with Python and Pycharm
body: <p>I am trying to connect to the Google App Engine Datastore from my local machine. I have spent all day digging in to this without any luck.</p>
  
  <p>I have tried the approach here (as well as alot of other suggestions from SO such as <a href="https://stackoverflow.com/questions/27057935/using-gcloud-python-in-gae">Using gcloud-python in GAE</a> and <a href="https://stackoverflow.com/questions/34584937/unable-to-run-dev-appserver-py-with-gcloud">Unable to run dev_appserver.py with gcloud</a>):</p>
  
  <p><a href="https://stackoverflow.com/questions/34572330/how-to-access-a-remote-datastore-when-running-dev-appserver-py/34575005#34575005">How to access a remote datastore when running dev_appserver.py?</a></p>
  
  <p>I first installed gcloud based on this description from google:
  <a href="https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27" rel="nofollow noreferrer">https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27</a> </p>
  
  <p>According to the description I should add the following to my appengine_config.py:</p>
  
  <pre><code>from google.appengine.ext import vendor
  vendor.add('lib')
  </code></pre>
  
  <p>If I do that I get an error saying <code>ImportError: No module named gcloud</code></p>
  
  <p>If I then move the code to my main.py it seems to pickup the lib-folder and the modules there. That seems a bit strange to me, since I thought appengine_config was being run first to make sure things were initialised.
  But now I am getting the following stack trace:</p>
  
  <pre><code>ERROR    2016-09-23 17:22:30,623 cgi.py:122] Traceback (most recent call last):
    File "/Users/thomasd/Documents/github/myapp/main.py", line 10, in &lt;module&gt;
      from gcloud import datastore
    File "/Users/thomasd/Documents/github/myapp/lib/gcloud/__init__.py", line 17, in &lt;module&gt;
      from pkg_resources import get_distribution
    File "/Users/thomasd/Documents/github/myapp/lib/pkg_resources/__init__.py", line 2985, in &lt;module&gt;
      @_call_aside
    File "/Users/thomasd/Documents/github/myapp/lib/pkg_resources/__init__.py", line 2971, in _call_aside
      f(*args, **kwargs)
    File "/Users/thomasd/Documents/github/myapp/lib/pkg_resources/__init__.py", line 3013, in _initialize_master_working_set
      dist.activate(replace=False)
    File "/Users/thomasd/Documents/github/myapp/lib/pkg_resources/__init__.py", line 2544, in activate
      declare_namespace(pkg)
    File "/Users/thomasd/Documents/github/myapp/lib/pkg_resources/__init__.py", line 2118, in declare_namespace
      _handle_ns(packageName, path_item)
    File "/Users/thomasd/Documents/github/myapp/lib/pkg_resources/__init__.py", line 2057, in _handle_ns
      loader.load_module(packageName)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 246, in load_module
      mod = imp.load_module(fullname, self.file, self.filename, self.etc)
    File "/Library/Python/2.7/site-packages/google/cloud/logging/__init__.py", line 18, in &lt;module&gt;
    File "/usr/local/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 999, in load_module
      raise ImportError('No module named %s' % fullname)
  ImportError: No module named google.cloud.logging.client
  </code></pre>
  
  <p>What am I doing wrong here?</p>