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.

3
  • 2
    Looks like this post might be able to solve your problem. Commented Aug 17, 2016 at 8:38
  • @ShubhamVasaikar Thank you, it worked! Commented Aug 17, 2016 at 8:41
  • In my case I was accidentally in a Python virtualenv that messed things up, "deactivate" helped Commented Feb 8, 2019 at 15:58

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
pythonw.exe is for GUI applications and python.exe is for terminal applications. It's described in depth here : stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.