2

I have both Python 3.5.2 and Python 2.7.12 Installed (On Windows). But when I try to deploy from Using Google App Engine SDK for Python, I receive this error message:

in <module>
    run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
NameError: name 'execfile' is not defined
2016-08-17 11:28:50 (Process exited with code 1)

I can only deploy from the command line:

C:\Python27\python.exe "C:\Program Files (x86)\Google\google_appengine\appcfg.py" update app.yaml

Is there a way to deploy with Python 2 and not Python 3? Without using the command line? And how do I report to Google about this bug, I think if they want they can fix it for Google App Engine SDK.

Uri
  • 2,992
  • 8
  • 43
  • 86

1 Answers1

2

You need to select the correct Python path, when you have multiple copies of Python the wrong path might be selected as the default.
Usually it's C:\Python27\pythonw.exe however it may be something else if you changed that during installation.
Go to the Google App Engine Launcher and change the path to the one you want in Edit/Preferences.

Meghdeep Ray
  • 5,262
  • 4
  • 34
  • 58
  • Thank you, I used `C:\Python27\python.exe` and it works. It also works with `C:\Python27\pythonw.exe`, does it matter which one I select? – Uri Aug 17 '16 at 08:59
  • 1
    pythonw.exe is for GUI applications and python.exe is for terminal applications. It's described in depth here : http://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe – Meghdeep Ray Aug 17 '16 at 10:12