Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working

I installed Python 2.7.2 (Win7 32-bit) and the Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. The default folder location for Python and GAE. When I try to start the helloworld project, as described in the Getting Started with Google Python document, the Start View button does not activate. The GAE SDK is supposed to do great with Python 2.7.

Is there a complete list of environment variables needed for this installation to work? Until now, all the messages that I saw belong to users who have passed this absolutely basic step.

+8
python windows google-app-engine
source share
8 answers

There are some issues in Google docs for configuring GAE with Python 2.7. If you try to run the basic hello world application through the App Engine GUI, following the instructions, are you likely to see red text and all buttons in gray?

If this is so, it is due to the fact that there are errors in your helloworld.py program - Google instructions could not be followed here.

The import statement that they have in the instructions:

import webapp2 

This fails, it must point to a local GAE webapp instance. In addition, their Python 2.7 program is incomplete. If you look at the Python 2.5 example, you will see the full program (you may need to change webapp -> webapp2 for Python 2.7?):

 from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, webapp World!') application = webapp.WSGIApplication( [('/', MainPage)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() 

Last thing, the YAML file in Google instructions refers to "helloworld.app" - I canโ€™t confirm this, but I think it should be "helloworld.py" ?? I donโ€™t know, I could be wrong.

A couple of months have passed since you posted the question, if you find any details, feel free to update this question.

+3
source share

I ran into the same problem, the browse button is disabled. I ran the dev_appserver.py helloworld command on the command line and then opened localhost: 8080 in my browser, the welcome world program worked successfully.

+2
source share

I compared the helloworld example with a guestbook demo and found that the application element is the key. I added the line at the top of the app.yaml application "application: helloworld", and the helloworld example started working in the Google App Engine (GAE). Note that the 'application' element must be optional, as defined in the app.yaml link. This seems to be optional if you are using the command line, and this is optional if you are using GAE.

+2
source share

Do you see anything in the GAE SDK magazines?

Which browser are you using? What is your default browser?

The default security settings in IE require that you enable intranet access.

I recently had to rebuild my Win7 box. Chrome was my default browser. When I installed the GAE SDK v1.6.1, I had a similar problem with what you described.

I checked the logs and staggered using the browser configuration to solve this problem.

My recollection was that after I re-enabled IE 9 in my default browser, I saw a security error on the intranet. After enabling access to intranet sites such as localhost: 8080, everything started to work fine, but the launch was slow. Then I made Chrome my default browser again, and the launch became a little faster and more reliable.

0
source share

I am sure that this is due to the fact that you changed the encoding from ANSI to another type (for example, UTF-8) on app.yaml,

change it to ANSI, then you can run the project in the Google app launcher.

BTW, the helloworld google tutorial has no problem.

0
source share

I had a similar problem; it turned out that my problem was not related to environment variables.

Debugging GAE:

First of all, let me say that if you have problems with GAE, I highly recommend starting with the CLI, google_appengine/dev_appserver.py . There is a large stack trace of the reason GAE fails (instead of just a red link in the Launcher GUI GUI) that will point you in the right direction.

Hidden bad characters:

When copying text from the google tutorial "hello world", there was an invisible hidden character at the beginning of my YAML file (I found it with kdiff, the diff tool). After deleting this symbol, my application started (and showed that it is not red in the Launcher GUI GUI).

Environment Variables:

As for your original question, the only environment variable I set is my PATH variable, where I added the folder of my python executable (in my case C: \ Python27) so that I can run python files without specifying the full path to Python. Let me repeat, however, that I do not believe that this is the cause of your problem, but you can more directly confirm this with the CLI.

0
source share

Like pghprogrammer4 above , I solved this problem by deleting bad characters in my files. They were invisible in my regular text editor (sublime text 2), but I found them in the hex editor. I knew what to look for because I noticed a space at the beginning of my guest application (several guides). So I looked at debugging in Chrome and showed the Zero Width Space symbol. The Unicode site has the hexadecimal value of this character, so I searched for it (I did not have to look far, these were the first three bytes of the file) and deleted it. Fortunately, Sublime Text 2 has hexadecimal mode, but you can use any hex editor to find and remove bad characters.

I am sure this is due to a very specific method of copying and pasting from Google. This did not happen to me in the Hello World example, because I typed it manually. Then it appeared in one of my files, resulting in CSS not loading. After that, he made the Google App Engine Launcher think that my project has missing files (blushes in the launcher). I returned the working version (just canceling it in a text editor) and copied each set of new commands to a file from the tutorial, hoping to catch the script bit that was haunting me. But when I got to the end, everything worked. I SECURE that this error occurs when you copy and paste the ANTIRE text box from the Google App Engine training site and paste it into one of your files. I suspect that the ZWSP character exists on this site as the first character in the codes or something like that, but it is late, and I will not consider it further.

I think you should just type textbooks - this is probably the best way to learn anyway.

0
source share

I made two changes together - 1. added a line at the top of the app.yaml application "application: helloworld" 2. changed the last line in app.yaml "script: helloworld.app" to "script: helloworld.py"

my gae started to work. However, to eliminate the problem, I "disabled" both changes, it turns out that the second change - changing helloworld.app to helloworld.py did the magic

0
source share

All Articles