简体   繁体   English

无法将本地主机:8000 与 Google App Engine 绑定

[英]Unable to bind local host:8000 with Google App Engine

I am trying to run a Python app in Google App Engine.我正在尝试在 Google App Engine 中运行 Python 应用程序。 The UI doesn't work so I tried using the command lines. UI 不起作用,所以我尝试使用命令行。 I tried restarting my PC, I tried changing port with "dev_appserver.py --port=9999 ."我尝试重新启动我的电脑,我尝试使用“dev_appserver.py --port=9999”更改端口。 but it still says Unable to bind localhost:8000 :但它仍然说Unable to bind localhost:8000

    raise BindError('Unable to bind %s:%s' % self.bind_addr)
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind localhost:8000

The app server starts two servers;应用服务器启动两台服务器; one for your application, the other for the development console .一个用于您的应用程序,另一个用于开发控制台 It is that second server that is causing the problem here;这是导致问题的第二台服务器; it normally would be run on port 8000.它通常会在端口 8000 上运行。

Change the ip address for the development console with the --admin_port switch:使用--admin_port开关更改开发控制台的 IP 地址:

dev_appserver.py --admin_port=9000

You may still want to change the port for the main application server too, of course.当然,您可能还想更改主应用程序服务器的端口。

Also see the command-line arguments documentation for dev_appserver.py .另请参阅dev_appserver.py命令行参数文档

It is possible some application is binding to your port in autostart event.某些应用程序可能在自动启动事件中绑定到您的端口。 It's highly probable to be the same service you are trying to run.很可能与您尝试运行的服务相同。 In that case try killing the process在这种情况下,请尝试终止进程

ps -ef | grep 'process_name'

Use kill -9 'pid' to end the process.使用kill -9 'pid'结束进程。

计算机重启做到了,关闭谷歌应用引擎启动器,重新启动计算机然后再次启动成功了......

终止旧终端并从新终端开始,这是我能找到的最简单的方法

Being unable a port is usually a sign of one of two things:无法访问端口通常是以下两种情况之一的标志:

  • You don't have permissions您没有权限
  • Something is already running there.有些东西已经在那里运行了。

You can try hitting the local port 8080 with your browser to see what is there, and kill it if it shouldn't be.您可以尝试使用浏览器访问本地端口 8080 以查看那里有什么,如果不应该将其杀死。

As for permissions - only look for this afterwards.至于权限 - 只在事后查找。 Presuming you are in windows (you didn't specify this), then you should be able to bind this as a normal user.假设您在 Windows 中(您没有指定这一点),那么您应该能够将其绑定为普通用户。

As for the command line - have you tried replacing the "=" with a space - I've seen both forms in documentation for app-engine.至于命令行——你有没有试过用空格替换“=”——我在 app-engine 的文档中看到了这两种形式。

dev_appserver.py --port 9999 .

暂无
暂无

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

相关问题 在谷歌应用程序引擎中运行示例应用程序时出现“无法绑定localhost:8000”错误 - “Unable to bind localhost:8000” error while running sample application in google app engine Google App Engine本地主机问题 - Google App Engine Local Host Issue 无法通过https协议在本地Google App Engine沙箱中发布到主机 - Unable to post to a host via https protocol in local Google App Engine sandbox python google-cloud-sdk/bin/dev_appserver.py --host **.22*.74* --port 8000 ./out/app_engine/ - python google-cloud-sdk/bin/dev_appserver.py --host **.22*.74* --port 8000 ./out/app_engine/ 使用python编写的response.out.write,Google App引擎未显示在本地主机上 - response.out.write in python, google app engine not displaying on local host 为什么我的HTML页面没有显示在Google App Engine的本地主机上? - Why is my HTML page not being displayed on the local host in Google App Engine? 从Google App Engine dev_appserver获取非本地主机名 - Get non-local host name from Google App Engine dev_appserver Google App Engine - 应用程序无法发送日志 - Google App Engine - App was unable to send logs 无法在本地 flask python3 环境中使用 Google 应用引擎中的 Cloud NDB - Unable to use Cloud NDB in local flask python3 environment with google app engine 带有 Postgresql 的 Google App Engine 上的 SQLAlchemy 和 pg8000 KeyError/Broken Pipe - SQLAlchemy and pg8000 KeyError / Broken Pipe on Google App Engine with Postgresql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM