简体   繁体   English

App Engine开发服务器:错误的运行时进程端口['']没有名为google.appengine.dist27.threading的模块

[英]App Engine dev server: bad runtime process port [''] No module named google.appengine.dist27.threading

When I try to run any of my app engine projects by python GoogleAppEngineLauncher I got the error log as follows: 当我尝试通过python GoogleAppEngineLauncher运行我的任何app引擎项目时,我得到了错误日志,如下所示:

Does anyone have any ideas of what's going on? 有没有人知道发生了什么? I tried remove the SDK and reinstall it. 我尝试删除SDK并重新安装它。 Nothing happens. 什么都没发生。 Still got the same error. 仍然有同样的错误。

Everything is working fine and I don't think I made any changes before this happens. 一切都很好,我认为在此之前我没有做任何改变。 The only thing that I can think of is that I install bigquery command line tool before this happens. 我能想到的唯一一件事就是在此之前我安装了bigquery命令行工具。 But I don't think this should be the reason of this. 但我不认为这应该是这个的原因。

bad runtime process port ['']

Traceback (most recent call last): Traceback(最近一次调用最后一次):

File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/_python_runtime.py", line 197, in _run_file( file , globals()) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/_python_runtime.py", line 193, in _run_file execfile(script_path, globals_) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 175, in main() File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 153, in main sandbox.enable_sandbox(config) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/ 文件“/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/_python_runtime.py”,第197行,在_run_file( 文件 ,全局())文件中“ /Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/_python_runtime.py“,第193行,在_run_file execfile(script_path,globals_)文件”/ Users / txzhang / Documents / App / GoogleAppEngineLauncher.app / Contents / Resources / GoogleAppEngine-default.bundle / Contents / Resources / google_appengine / google / appengine / tools / devappserver2 / python / runtime.py“,第175行,在main()文件中” /Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/runtime.py“,第153行,位于主沙箱中.enable_sandbox(config)文件“/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/ GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 159, in enable_sandbox import ('%s.threading' % dist27. GoogleAppEngine-default.bundle / Contents / Resources / google_appengine / google / appengine / tools / devappserver2 / python / sandbox.py“,第159行,在enable_sandbox 导入中 ('%s .threading'%dist27。 name ) File "/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 903, in load_module raise ImportError('No module named %s' % fullname) ImportError: No module named google.appengine.dist27.threading 名称 )文件“/Users/txzhang/Documents/App/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py”,第903行,在load_module中引发ImportError('没有名为%s'的模块'%fullname)ImportError:没有名为google.appengine.dist27.threading的模块

The most probable reason is having another python package that is coming from google. 最可能的原因是有另一个来自谷歌的python包。 Run python in verbose mode with python -vvvvv and try following command import google . 使用python -vvvvv以详细模式运行python并尝试执行以下命令import google

If the above import is successful make sure its coming from /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google which is the path of python google appengine libraries on my system (OSX, fresh install of google appengine sdk). 如果上述导入成功,请确保它来自/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google这是我系统上的python google appengine库的路径(OSX,全新安装google appengine sdk)。

If that is not the case (but the import is successful) then its most likely other existing google libraries which are creating issue and the path of the same would be visible on python prompt after the successful import google command like following: 如果不是这种情况(但导入成功)那么在成功import google命令之后,最有可能在创建问题的其他现有谷歌库以及相同的路径将在python提示符下可见:

>>> import google >>>导入谷歌

import google # loaded from Zip /Library/Python/2.7/site-packages/protobuf-2.4.1-py2.7.egg/google/ init .pyc 导入谷歌#从Zip /Library/Python/2.7/site-packages/protobuf-2.4.1-py2.7.egg/google/ init .pyc加载

In this case my google protobuf package was the culprit. 在这种情况下,我的谷歌protobuf包是罪魁祸首。

Solution: 解:

  1. Use virtualenv : If you haven't used python virtualenv before, may be this is the best time to use it. 使用virtualenv :如果你之前没有使用过python virtualenv,可能这是使用它的最佳时机。 (a) Make sure that your PYTHONPATH variable is not set to include anything that has a google package! (a)确保您的PYTHONPATH变量未设置为包含任何具有Google软件包的内容! Unset it running unset PYTHONPATH (in your bash prompt) unless you are very sure what you have there. 取消unset PYTHONPATH它运行未unset PYTHONPATH (在你的bash提示符中),除非你非常确定你在那里有什么。 (b) Create a new python virtualenv, activate it and try to run google appengine commands in it: (b)创建一个新的python virtualenv,激活它并尝试在其中运行google appengine命令:

     virtualenv --no-site-packages /tmp/googleapps virtualenv --no-site-packages / tmp / googleapps\nsource /tmp/googleapps/bin/activate source / tmp / googleapps / bin / activate\ndev_appserver.py path_to_google_app dev_appserver.py path_to_google_app\n
  2. Remove conflicting packages from path: Move conflicting packages a new virtualenv. 从路径中删除冲突的包:将冲突的包移动到新的virtualenv。 This is likely to break other stuff so not recommended . 这很可能打破其他东西,所以不推荐

I had hit the same issue today. 我今天遇到了同样的问题。 This being the top result on google but lacked any answers, I add this after fixing same issue on my system. 这是谷歌的最佳结果,但没有任何答案,我在我的系统修复相同的问题后添加此。 There may be other possible reasons which thankfully I haven't come across. 可能有其他可能的原因,谢天谢地我没有遇到过。

Good luck! 祝好运!

A recent upgrade of the development SDK started causing this problem for me. 最近升级的开发SDK开始给我带来这个问题。 After much turmoil, I found that the problem was that the SDK was in a sub-directory of my project code. 经过多次动荡之后,我发现问题在于SDK是在我的项目代码的子目录中。 When I ran the SDK from a different (parent) directory the error went away. 当我从另一个(父)目录运行SDK时,错误就消失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:App Engine上的运行时进程端口['']错误 - Error: bad runtime process port [''] on App Engine 没有名为 appengine.ext google app engine 的模块 - No module named appengine.ext google app engine Google App Engine:ImportError:没有名为appengine.ext的模块 - Google App Engine: ImportError: No module named appengine.ext 在 Google App Engine 上部署 Django 应用程序后出现“没有名为 appengine.base 的模块”错误 - “No module named appengine.base” error after deploying Django app on Google App Engine Python上的Google App Engine“ ImportError:没有名为google.appengine.ext的模块” - Google App Engine on Python “ImportError: No module named google.appengine.ext” Google App Engine(Python 2.7)Win 10 ImportError:没有名为appengine.api的模块 - Google App Engine (Python 2.7) Win 10 ImportError: No module named appengine.api 如何分析 Google App Engine python27 运行时(不是 python) - How to profile Google App Engine python27 runtime (not python) python运行时中Appengine开发服务器上的模块初始化错误 - Module initialization error on appengine dev server in python runtime 将PRAW与Google App Engine结合使用:没有此类文件或目录'/ base / data / home / runtimes / python27 / python27_dist / python' - Using PRAW with the Google App Engine: no such file or directory '/base/data/home/runtimes/python27/python27_dist/python' Google App Engine'没有名为pwd的模块' - Google App Engine 'No module named pwd'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM