简体   繁体   中英

Cannot set up Google App Engine for Python 2.7 on OSX 10.6

Trying to run the Python 2.7 dev environment for Google App Engine on Mac OSX (10.6.8), but I cannot get the helloworld example won't run.

I cannot import webapp2 in a Python shell. When I try to run from the GUI, the log reports that my "Python command" is /usr/bin/python2.6, though my system default is 2.7. When I try to visit localhost:8080 I get "ImportError: No module named urllib".

Tried launching from the command line with /usr/local/google_appengine/dev_appserver.py helloworld/. Got error:

fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed): 
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl.

Thinking the application might be using 2.5, and per the "learn more" link, I installed ssl to Python2.5 (downloaded code, << sudo python2.5 setup.py install >>). While I could now import ssl into a Python 2.5 shell, I still got the same error when running the dev server.

I did do my own install of Python 2.7 on this computer, so it is possible that in doing so I broke / missed something subtle.

Also, the software README refers only to 2.5, and has a latest date of April 2008. I see only one Python download at the downloads page

Any help would be appreciated.

You shouldn't be able to import webapp2 in Python shell since webapp2 is not in the default packages.

Make sure that you have the latest Launcher for MacOS running on your computer and try the following:

  • Run the GoogleAppEngineLauncher
  • File > New Application...
  • Choose a name and press Create
  • Press Run
  • Press Browse

If following the above steps you will see the Hello, world! in the browser then you are good to continue with your Hello, world! application.

If not make sure that you're running the dev_appserver.py from a command line by using the correct version of Python, or if you're running using the Launcher in the preferences you might need to add the Python Path to point to the python2.7 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM