3

我已经成为 GAE Go 开发人员一年了,看到 SDK在 Windows 上可用,我想我会尝试一下。但是,我在查找有关如何从头开始正确安装它的任何文档时遇到问题。我不知道要采取什么步骤来确保我的项目能够正常运行,所以我想知道在 Windows 上安装和配置 Google App Engine Go SDK 和 GoClipse 的正确方法是什么?

4

1 回答 1

9

Same here. The GAE GO SDK needs some more Windows install instructions...

As of today 2012-07-28 I just got it working on Win 7 by:

  • downloading the App Engine SDK for GO here: developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go and selected the Win 32 bit in my case googleappengine.googlecode.com/files/go_appengine_sdk_windows_386-1.7.0.zip

  • I unzipped the GO SDK in C:\googleappenginego (make it the name you like).

  • Then I added that folder path to the PATH environment variable in th System settings Advanced Settings:

My "Path" is set at:

C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files (x86)\Windows Live\Shared;C:\SWTOOLS\ReadyApps;%JAVA_HOME%\bin;C:\googleappenginego\
  • I installed Python 2.7.3 from: www.python.org/download/ selected this version: www.python.org/ftp/python/2.7.3/python-2.7.3.msi I installed it in the default folder C:\Python27 by launching the python-2.7.3.msi file

  • I created the GO GAE project as indicated in the GAE GO Getting Started series: developers.google.com/appengine/docs/go/gettingstarted/helloworld

  • After creating the C:\myapp\app.yaml and C:\myapp\hello\hello.go, launch the project by opening a cmd window from the Win "Start/Run..." menu.

Then type in: "dev_appserver.py c:\myapp\" You should see something like:

WARNING  2012-07-28 12:32:20,154 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
INFO     2012-07-28 12:32:20,650 appengine_rpc.py:160] Server: appengine.google.com
INFO     2012-07-28 12:32:20,654 appcfg.py:582] Checking for updates to the SDK.
INFO     2012-07-28 12:32:22,119 appcfg.py:600] The SDK is up to date.
WARNING  2012-07-28 12:32:22,150 dev_appserver.py:3498] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError:
No module named _imaging
INFO     2012-07-28 12:32:22,163 dev_appserver_multiprocess.py:647] Running application dev~helloworld on port 8080: http://localhost:8080
INFO     2012-07-28 12:32:22,164 dev_appserver_multiprocess.py:649] Admin console is available at: http://localhost:8080/_ah/admin
INFO     2012-07-28 12:32:36,851 __init__.py:440] building _go_app
INFO     2012-07-28 12:32:37,849 __init__.py:417] running _go_app, HTTP port = 34762, API port = 42835
WARNING  2012-07-28 12:32:38,443 dev_appserver.py:2733] Failed removing c:\users\fred\appdata\local\temp\request.8mmuoy.tmp
INFO     2012-07-28 12:32:38,480 dev_appserver.py:2952] "GET / HTTP/1.1" 200 -
INFO     2012-07-28 12:32:38,588 dev_appserver.py:2952] "GET /favicon.ico HTTP/1.1" 200 -
INFO     2012-07-28 12:32:54,849 __init__.py:440] building _go_app
INFO     2012-07-28 12:32:55,755 __init__.py:417] running _go_app, HTTP port = 34762, API port = 42835
WARNING  2012-07-28 12:32:56,572 dev_appserver.py:2733] Failed removing c:\users\fred\appdata\local\temp\request.slayyf.tmp
INFO     2012-07-28 12:32:56,602 dev_appserver.py:2952] "GET / HTTP/1.1" 200 -
INFO     2012-07-28 12:32:56,694 dev_appserver.py:2952] "GET /favicon.ico HTTP/1.1" 200 -

Then go into your browser and go to "http://localhost:8080" to see your app or "http://localhost:8080/_ah/admin/" for the admin console.

Change the hello.go file, change "Hello, world" to "Hello, galaxy" for example and refresh the localhost:8080 browser window. It should show the new message without crashing or restarting the server. See right below:

NOTE: don't install Python 2.5.x, that was my initial mistake, despite what the GO SDK says. It will run but it dies when I modify the hello.go source code and refresh the browser window with some like that:

<type 'exceptions.AttributeError'>: 'module' object has no attribute 'kill' 
      args = ("'module' object has no attribute 'kill'",) 
      message = "'module' object has no attribute 'kill'"
于 2012-07-28T13:42:02.357 回答