GAE无法找到" lib"目录?

时间:2015-12-31 17:14:49

标签: python google-app-engine

我正在运行dev_appserver.py .并收到以下内容:

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 -

查看错误,{em> /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext中的os.path.isdir(path)似乎返回False / vendor / init .py

从项目目录运行Python解释器,我得到以下内容:

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

但是当我在 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/vendor/ init中运行完全相同的代码时 .py ,isdir返回False。我还检查了绝对文件名,得到了相同的结果。

项目文件夹中的

ls -l确认lib目录及其子目录与项目中的其他文件/目录具有相同的所有者和权限。我还对该项目和GAELauncher进行了全面的重新安装,没有任何改进。

可能出现什么问题?

1 个答案:

答案 0 :(得分:3)

OP已经为自己解决了这个问题,但对于遇到此问题的其他人,请检查lib中的skip_files下是否列出了app.yaml目录。

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