4
votes

I'm running dev_appserver.py . and receiving the following:

INFO     2015-12-31 17:03:19,562 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO     2015-12-31 17:03:19,935 sdk_update_checker.py:257] The SDK is up to date.
INFO     2015-12-31 17:03:19,960 api_server.py:205] Starting API server at: http://localhost:51561
INFO     2015-12-31 17:03:19,964 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2015-12-31 17:03:19,965 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR    2015-12-31 17:03:23,744 wsgi.py:263] 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/lib_config.py", line 354, in __getattr__
self._update_configs()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/lib_config.py", line 290, in _update_configs
self._registry.initialize()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/lib_config.py", line 165, in initialize
import_func(self._modname)
  File "/Users/iMac/Repos/my_project/appengine_config.py", line 11, in <module>
vendor.add('lib')
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/vendor/__init__.py", line 44, in add
    'No such virtualenv or site directory' % path)
ValueError: virtualenv: cannot access lib: No such virtualenv or site directory
INFO     2015-12-31 17:03:23,749 module.py:787] default: "GET / HTTP/1.1" 500 -

Looking at the error, os.path.isdir(path) seems to be returning False in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/vendor/init.py

Running the Python interpreter from the project directory, I get the following:

Python 2.7.10 (default, Aug 22 2015, 20:33:39) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isdir("lib")
True

But when I run that exact same code in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/vendor/init.py , isdir returns False. I also checked with absolute filenames, and got the same result.

ls -l in the project folder confirms that the lib directory and its subdirectories have the same owner and permissions as the other files/directories in the project. I also did a full re-install of the project and of GAELauncher, with no improvement.

what could be going wrong?

1
do you have a lib dir in your app/default module dir? You seem to have one configured in your appengine_config.py file... - Dan Cornilescu
yes, i ran this in my app directory pip install -r requirements.txt -t lib per the directions in the docs and can see the directory and the packages in it - Justin
I think I ran into this error when I tried to install gitkit as a 3rd party lib and I didn't have pip version 6.0.0 (I wasn't using virtualenv). In the end I dropped pip and vendored in the necessary libs manually (wasn't too bad, all Google libs.). - Dan Cornilescu
I renamed the directory and got it working... i'm wondering if there is some sort of naming conflict. Renaming it back to "lib" causes the issue again. - Justin
do you have pip 6.0.0 (or newer)? it is required, see cloud.google.com/appengine/docs/python/tools/… (renaming lib can simply make the code skip the problem area because there is no lib dir present) - Dan Cornilescu

1 Answers

4
votes

OP has resolved the issue for himself, but for anyone else who comes across this, check that you don't have the lib directory listed under skip_files in app.yaml.

skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?\..*$
- ^(.*/)?node_modules$
- ^venv$
- ^lib$ # <-- WTF??? ##