Problems with dev_appserver.py in Google app

I am just starting with the Google engine, and I have been following a basic welcome example in the Google App Engine.

https://developers.google.com/appengine/docs/python/gettingstartedpython27/helloworld

created both files in the helloworld folder.

I do not want to use the graphical interface, which I prefer to use the mac terminal to work with this application. I want to run this application on localhost localhost: 80 through a terminal.

to run my main helloworld application locally everything i say is

$ dev_appserver.py helloworld. but I get this error.

Traceback (most recent call last): File "/usr/local/bin/dev_appserver.py", line 184, in <module> _run_file(__file__, globals()) File "/usr/local/bin/dev_appserver.py", line 180, in _run_file execfile(script_path, globals_) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 727, in <module> main() File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 720, in main dev_server.start(options) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 554, in start options.yaml_files) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 556, in __init__ module_configuration = ModuleConfiguration(yaml_path) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 82, in __init__ self._yaml_path) File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 271, in _parse_configuration with open(configuration_path) as f: IOError: [Errno 2] No such file or directory: 'helloworld' 

I have two files in the helloworld directory. app.yaml

 application: your-app-id version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: helloworld.application 

and helloworld.py

 import webapp2 class MainPage(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.write('Hello, World!') application = webapp2.WSGIApplication([ ('/', MainPage), ], debug=True) 
+7
python google-app-engine
source share
4 answers

I had the same problem. After some effort, the team that worked for me is inside the google_appengine directory, not the helloword directory:

python dev_appserver.py helloworld/

perhaps this helps.

+3
source share
  • When you first start Google App Engine, the prompt asks if you want to create "Command Symbols" - be sure to click "OK", then enter the administrator password. This allows the use of symbolic links in the / usr / local / bin folder for the dev_appserver.py .

  • Enter the following into the terminal (at the command line):

     $: /usr/local/bin/dev_appserver.py helloworld 

Here is an example of what my browser, terminal and search windows look like.

For reference, here is O'Reilly's guide to installing / running the google engine on Mac.

  1. To close the web server, make sure the terminal window is active, then press Control-C
0
source share

After installing google cloud sdk you started

 gcloud components install app-engine-go 

The documentation looks ridiculous in terms of organization. I completely missed this when I first started

0
source share

From the directory ... \ Google \ Cloud SDK \ google-cloud-sdk \ bin:

Instead:

 dev_appserver.py YOUR_DIRECTORY 

Try:

 py dev_appserver.py YOUR_DIRECTORY 

Or:

 python dev_appserver.py YOUR_DIRECTORY 
0
source share

All Articles