[英]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 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.