在 OS X Lion 上将 GAE 升级到 1.7.6 后,我在运行 dev_appserver.py 时遇到无法解决的错误。它在以前的版本中运行良好。最初错误说我需要使用 pip 安装 PyObjC 和 PIL,我确实这样做了。现在,它显示 can't open file '/usr/local/bin/_python_runtime.py': [Errno 2] No such file or directory
。这是完整的错误:
INFO 2013-04-01 23:01:15,091 sdk_update_checker.py:244] Checking for updates to the SDK.
INFO 2013-04-01 23:01:15,660 sdk_update_checker.py:272] The SDK is up to date.
INFO 2013-04-01 23:01:15,705 api_server.py:152] Starting API server at: http://localhost:50096
INFO 2013-04-01 23:01:15,721 dispatcher.py:98] Starting server "default" running at: http://localhost:8080
INFO 2013-04-01 23:01:15,759 admin_server.py:117] Starting admin server at: http://localhost:8000
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/usr/local/bin/_python_runtime.py': [Errno 2] No such file or directory
ERROR 2013-04-01 23:01:15,785 http_runtime.py:221] unexpected port response from runtime ['']; exiting the development server
INFO 2013-04-01 23:01:16,775 api_server.py:517] Applying all pending transactions and saving the datastore
INFO 2013-04-01 23:01:16,775 api_server.py:520] Saving search indexes
Exception in thread Thread-1 (most likely raised during interpreter shutdown)
我发现了一篇关于此的类似帖子 here ,但它是在 Windows 7 机器上,他似乎没有找到解决方案(或者他找到了但没有跟进)。有什么想法吗?
编辑:它适用于 GoogleAppEngineLauncher GUI,但不适用于命令行。不知道为什么。
最佳答案
根据我对 Fat Lotus 的回复,以下是对我有用的内容:
我再次更新了 GAE Launcher,它重新创建了符号链接(symbolic link),现在它工作正常。 /usr/local/bin/_python_runtime.py
链接到的当前符号链接(symbolic link)是 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-de fault.bundle/Contents/Resources/google_appengine/_python_runtime.py
关于python - dev_appserver.py 给我一个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15753632/