5

When I install the Google App Engine SDK and run the launcher, it asks me to configure the python location:

enter image description here


And when I open Preferences, it asks for a path to a python executable:

enter image description here


Which path should I insert and what is the difference:

  • C:\Python27\python.exe
  • C:\Python27\pythonw.exe
Mori
  • 8,137
  • 19
  • 63
  • 91

5 Answers5

4

Looks like Google App Engine couldn't find your python installation. It looks for Python by checking the PATH environment variable, so it's best to use it.

The short answer is use C:\Python27\pythonw.exe. I've just installed the latest "GoogleAppEngine-1.9.33.msi", and after I ran "Google App Engine launcher" (C:\Program Files (x86)\Google\google_appengine\launcher\GoogleAppEngineLauncher.exe), in "Edit -> Preferences" I saw "C:\Python35\pythonw.exe". (It is because I have Python 3.5 folder before Python 2.7 folder in my Path environment variable setting.) But the point is App Engine launcher (or installer) chose the pythonw.exe over python.exe all by itself.

enter image description here

But as a better solution, I would suggest you to set your Path environment variable, this will prevent other similar issues in the future.

To set Python on the Path, if it's not set:

  1. Right click "Computer" (or "My Computer") and choose "System Properties";
  2. Switch to "Advanced" tab;
  3. Press "Environment variables" button;
  4. Double click "Path" variable in the lower list of system variables;
  5. In the opened window in "Values" add C:\Python27\;C:\Python27\Scripts; to the beginning of the line. Make sure you don't accidently delete anything there!
  6. Press "OK" in this window and "OK" in "Environment variables" window and you're good to go.

Alternatively in item 5, you might want to use user's PATH from the upper list. I would set Python for all users as I described.

Now launch Google App Engine via "Google App Engine Launcher" and see if in "Edit -> Preferences" you have either "Default if not set: C:\Python27\pythonw.exe" or "Default if not set: C:\Python27\python.exe" written below the field for "Python path". If there's still nothing similar, then it's not the launcher that checks for PATH, but it's the Installer. Then now it's time to uninstall "Google App Engine" and install it again. After this everything should work as expected. (Btw, Installer checks for Python and other dependecies, so it should report if there're any errors.)

The main difference between python.exe and pythonw.exe is:

  • python.exe opens console widow when a module is executed with it, or, if run directly from command line, executes a module in a current console window preventing any further commands until the module exits. So basically intended for console applications or debugging.
  • pythonw.exe on the other hand is intended for GUI apps or no-GUI apps, so if a module is executed with pythonw.exe, then there's no console window is open, if run via current console a module is executed in a separate process and the console is available for further commands right away. The drawback is no output is provided in this case, i.e. no errors printed as there's no console window associated with running Python module.

Fore details see: official docs, chapter from a book(small but informative), Python mailing list.

Now regarding Google App Engine, on installation page they state:

You will need Python 2.7 to use the App Engine SDK, because the Development Server is a Python application. Download Python 2.7.X (don't use a higher version) from the Python web site.

So since a server is a no-GUI application, that's probably why App Engine chooses pythonw.exe.

mx0
  • 6,445
  • 12
  • 49
  • 54
Nikita
  • 6,101
  • 2
  • 26
  • 44
  • Many thanks for the answer! However, my question still remains unanswered: what is the difference between them? When I use them, I see no difference _in action_. By the way, see this reliable reference by Edward Mitchell: [App Inventor 2 Databases and Files](https://books.google.com/books?id=ryB4CgAAQBAJ&pg=PT85&lpg=PT85&dq=Google+App+Engine+Launcher+Python+Path&source=bl&ots=5hH-h3eohq&sig=Hhzg8riA5pgJxZbXOl6CnYWq1xU&hl=en&sa=X&ved=0ahUKEwi5mPGGuaHLAhWnd5oKHeSKAaU4ChDoAQg1MAU#v=onepage&q=Google%20App%20Engine%20Launcher%20Python%20Path&f=false). – Mori Mar 03 '16 at 05:22
  • @Morri, sorry, I haven't found that in your original question, but anyway I updated the answer. Hope that now it solves your issue completely. You shouldn't see any difference, because even with `python.exe` the console window could still be suppresed. P.S. I couldn't see the page on the link you provided. – Nikita Mar 03 '16 at 06:37
  • Thanks again and sorry for the broken link! Please try [this one](https://books.google.com/books?id=ryB4CgAAQBAJ&pg=PT85&lpg=PT85&dq=%22Step+5+%E2%80%93+Run+Google+App+Engine+Launcher%22&source=bl&ots=5hH-hccper&sig=khUDafOcIXMKe33gkqg7ctPp5PU&hl=en&sa=X&ved=0ahUKEwiwrKuSgaTLAhUoIJoKHWO7CcIQ6AEIHTAA#v=onepage&q=%22Step%205%20%E2%80%93%20Run%20Google%20App%20Engine%20Launcher%22&f=false) and let me know what you think. – Mori Mar 03 '16 at 07:42
  • I think, that either they have no idea, that `pythonw.exe` exists (as e.g. it's strange that they suggest to remove all python and intall again just to fix the `path` variable instead of fixing it directly) or their software will print debug messages to console and in order to do that they need to use `python.exe` over `pythonw.exe`. – Nikita Mar 03 '16 at 08:21
2

According to this QA, pythonw seems to be preferable: https://code.google.com/p/googleappengine/issues/detail?id=11246

Here's the similiar question and answer: pythonw.exe or python.exe?

python.exe is a console (terminal) application for launching CLI-type scripts.

pythonw.exe is a GUI app for launching GUI/no-UI-at-all scripts.

Community
  • 1
  • 1
tsuda7
  • 413
  • 1
  • 6
  • 25
  • "_According to this QA, pythonw seems to be preferable_" But this one is the opposite: [Prerequisites for App Engine development are missing!](https://code.google.com/p/googleappengine/issues/detail?id=3937). "_python.exe is a console (terminal) application for launching CLI-type scripts._" But even if I use `pythonw.exe`, I don't see a terminal window to pop up. – Mori Feb 25 '16 at 08:58
  • `pythonw.exe` doesn't pop up a window, but `python.exe` does, according to the explanation. – tsuda7 Feb 25 '16 at 09:57
  • Sorry for the typo! I meant: even if I use `python.exe`, I don't see a terminal window to pop up. – Mori Feb 25 '16 at 20:17
2

From looking at the the docs: https://docs.python.org/2/using/windows.html#executing-scripts

Pythonw basically suppresses the console window. I wouldn't think you'd need one using the app-engine, so, pythonw.exe would be my best guess.

Abhinav Ramakrishnan
  • 1,070
  • 12
  • 22
0

The error message says python=None. Check if you can execute from cmd python -V to confirm your python build is accessible throughout the system. GAE generally can find your python installation automatically, and confirms your python path before installation.

Try this tutorial if its any help.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
rNov
  • 61
  • 1
  • 15
0

Pythonw.exe is the executable that does not open the console. Python.exe will open the console. You probably want to use pythonw.exe in this instance because I don't know why you would want a terminal open for the app engine.

https://docs.python.org/2/using/windows.html

The App Engine SDK also didn't find your installation of python. This is probably because you don't have the global env. variable declared.