title: App Engine not finding google.auth file in dev_appserver.py
body: <p>I'm receiving the following error when executing the dev_appserver.py:</p>
  
  <pre><code>from google.auth import app_engine
  File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/    python/runtime/sandbox.py"
  , line 1147, in load_module
      raise ImportError('No module named %s' % fullname)
  ImportError: No module named google.auth
  </code></pre>
  
  <p>Odd thing is when I deploy the app, it works fine. </p>
  
  <p>I tried:</p>
  
  <ol>
  <li>dev_appserver.py MY_DIRECTORY</li>
  <li>cd /google/google-cloud-sdk/bin/; python dev_appserver.py MY_DIRECTORY </li>
  <li>python  dev_appserver.py hello_world/</li>
  <li>Installed updated gcloud components install app-engine-go</li>
  </ol>
  
  <p>Additional info:</p>
  
  <ol>
  <li>No virtual env is being used.</li>
  <li>path to dev_appserver: /google/google-cloud-sdk/bin/dev_appserver.py</li>
  <li>I'm using Google's Console Cloudshell</li>
  <li><p>Here are the SDK versions:</p>
  
  <ul>
  <li>Google Cloud SDK 192.0.0</li>
  <li>alpha 2017.09.15</li>
  <li>app-engine-go</li>
  <li>app-engine-java 1.9.63</li>
  <li>app-engine-php " "</li>
  <li>app-engine-python 1.9.67</li>
  <li>app-engine-python-extras 1.9.63</li>
  <li>beta 2017.09.15</li>
  <li>bq 2.0.29</li>
  <li>cbt</li>
  <li>cloud-datastore-emulator 1.4.1</li>
  <li>core 2018.03.02</li>
  <li>datalab 20180213</li>
  <li>docker-credential-gcr</li>
  <li>gcd-emulator v1beta3-1.0.0</li>
  <li>gsutil 4.28</li>
  <li>kubectl</li>
  <li>pubsub-emulator 2018.02.02</li>
  </ul></li>
  </ol>
  
  <p>Files:</p>
  
  <p>app.yaml</p>
  
  <pre><code>runtime: python27
  api_version: 1
  threadsafe: true
  
  handlers:
  - url: /.*
    script: main.app
  
  libraries:
  - name: flask
    version: 0.12
  - name: six
    version: "1.9.0" 
  </code></pre>
  
  <p>appengine_config.py</p>
  
  <pre><code>from google.appengine.ext import vendor
  import os
  
  vendor.add(os.path.join(os.path.dirname(os.path.realpath(__file__)),'lib'))
  </code></pre>
  
  <p>main.py</p>
  
  <pre><code>import logging
  
  from flask import Flask
  from sheets import data
  
  app = Flask(__name__)
  
  
  @app.route('/')
  def hello():
      return 'Hello World!{}'.format(data)
  
  
  @app.errorhandler(500)
  def server_error(e):
      # Log the error and stacktrace.
      logging.exception('An error occurred during a request.')
      return 'An internal error occurred.', 500
  </code></pre>
  
  <p>sheets.py</p>
  
  <pre><code>from google.auth import app_engine
  import googleapiclient.discovery
  
  SCOPES = ['https://www.googleapis.com/auth/drive',
            'https://www.googleapis.com/auth/drive.file',
            'https://www.googleapis.com/auth/drive.readonly',
            'https://www.googleapis.com/auth/spreadsheets.readonly',
            'https://www.googleapis.com/auth/sqlservice.admin']
  
  spreadsheetId = '&lt;spreadsheet-id&gt;'
  rangeName = 'A1:A5'
  
  credentials = app_engine.Credentials(scopes=SCOPES)
  service = googleapiclient.discovery.build('sheets', 'v4', credentials=credentials)
  
  data = service.spreadsheets().values().get(spreadsheetId=spreadsheetId,     
  range=rangeName).execute()
  data = data.get('values',[])
  </code></pre>
  
  <p>/lib</p>
  
  <pre><code>.
  ..
  apiclient
  cachetools
  cachetools-2.0.1.dist-info
  google
  googleapiclient
  google_api_python_client-1.5.2.dist-info
  google_api_python_client-1.6.5.dist-info
  google_auth-1.4.1.dist-info
  google_auth-1.4.1-py3.6-nspkg.pth
  google_auth_httplib2-0.0.3.dist-info
  google_auth_httplib2.py
  google_auth_httplib2.pyc
  httplib2
  httplib2-0.10.3.dist-info
  oauth2client
  oauth2client-2.2.0.dist-info
  oauth2client-4.1.2.dist-info
  pyasn1
  pyasn1-0.4.2.dist-info
  pyasn1_modules
  pyasn1_modules-0.2.1.dist-info
  rsa
  rsa-3.4.2.dist-info
  simplejson
  simplejson-3.13.2.dist-info
  six-1.11.0.dist-info
  six.py
  six.pyc
  uritemplate
  uritemplate-0.6.dist-info
  uritemplate-3.0.0.dist-info
  </code></pre>
  
  <p>I solve the issue:</p>
  
  <p>The dev_appserver.py was not using the modules in my lib folder. Instead it was using the packages on my computer. To eliminate the issue, I removed all Google packages from my local machine and it works great now. </p>