如何从零开始正确配置GAE Go SDK和GoClipse在Windows上?

huangapple go评论78阅读模式
英文:

How to properly configure GAE Go SDK and GoClipse on Windows from scratch?

问题

我现在是我的中文翻译,代码部分不要翻译, 只返回翻译好的部分, 不要有别的内容, 不要回答我要翻译的问题。以下是要翻译的内容:

我已经是一个GAE Go开发者一年了,看到SDK在Windows上可用,我想试试。然而,我在找不到任何关于如何从头开始正确安装它的文档。我不知道应该采取什么步骤来确保我的项目能够正常运行,所以我想知道在Windows上安装和配置Google App Engine Go SDK和GoClipse的正确方法是什么?

英文:

I've been a GAE Go developer for a year now, and seeing that the SDK became available on Windows, I figured I'd try it out. However, I am having problems finding any documentation on how to install it properly from scratch. I have no idea what steps to take to ensure that my projects will be running properly, so I'd like to know what is the proper way to install and configure Google App Engine Go SDK and GoClipse on Windows?

答案1

得分: 9

同样的问题。 GAE GO SDK 需要一些更多的Windows安装说明...

截至今天2012-07-28,我刚刚在Win 7上使其工作:

  • 在这里下载GO的App Engine SDK:
    developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go
    并选择Win 32位版本
    googleappengine.googlecode.com/files/go_appengine_sdk_windows_386-1.7.0.zip

  • 我将GO SDK解压缩到C:\ googleappenginego(可以根据您喜欢的名称进行命名)。

  • 然后我将该文件夹路径添加到系统设置高级设置中的PATH环境变量中:

我的“Path”设置为:

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 \
  • 我安装了Python 2.7.3:
    www.python.org/download/
    选择这个版本:
    www.python.org/ftp/python/2.7.3/python-2.7.3.msi
    我将其安装在默认文件夹C:\ Python27中,通过运行python-2.7.3.msi文件进行安装

  • 我按照GAE GO入门系列中的指示创建了GO GAE项目:
    developers.google.com/appengine/docs/go/gettingstarted/helloworld

  • 在创建了C:\ myapp \ app.yaml和C:\ myapp \ hello \ hello.go之后,通过从Win“开始/运行...”菜单中打开cmd窗口来启动项目。

然后在命令行中键入:“dev_appserver.py c:\ myapp \”
您应该会看到类似以下的内容:

警告 2012-07-28 12:32:20,154 rdbms_mysqldb.py:74]由于无法加载MySQLdb库,因此rdbms API不可用。
INFO 2012-07-28 12:32:20,650 appengine_rpc.py:160]服务器:appengine.google.com
INFO 2012-07-28 12:32:20,654 appcfg.py:582]检查SDK的更新。
INFO 2012-07-28 12:32:22,119 appcfg.py:600]SDK已经是最新的。
警告 2012-07-28 12:32:22,150 dev_appserver.py:3498]无法初始化图像API;您可能缺少Python的“PIL”模块。 ImportError:
没有名为_imaging的模块
INFO 2012-07-28 12:32:22,163 dev_appserver_multiprocess.py:647]在端口8080上运行应用程序dev〜helloworld:http:// localhost:8080
INFO 2012-07-28 12:32:22,164 dev_appserver_multiprocess.py:649]管理控制台位于:http:// localhost:8080 / _ah / admin
INFO 2012-07-28 12:32:36,851 __init__.py:440]构建_go_app
INFO 2012-07-28 12:32:37,849 __init__.py:417]运行_go_app,HTTP端口= 34762,API端口= 42835
警告 2012-07-28 12:32:38,443 dev_appserver.py:2733]无法删除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]构建_go_app
INFO 2012-07-28 12:32:55,755 __init__.py:417]运行_go_app,HTTP端口= 34762,API端口= 42835
警告 2012-07-28 12:32:56,572 dev_appserver.py:2733]无法删除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 -

然后在浏览器中输入“http:// localhost:8080”以查看您的应用程序,或输入“http:// localhost:8080 / _ah / admin /”以查看管理控制台。

更改hello.go文件,将“Hello,world”更改为“Hello,galaxy”等,然后刷新localhost:8080浏览器窗口。它应该显示新的消息,而无需崩溃或重新启动服务器。请参见下面的内容:

**注意:**不要安装Python 2.5.x,这是我的最初错误,尽管GO SDK上说的。它可以运行,但当我修改hello.go源代码并刷新浏览器窗口时,它会崩溃,显示类似以下内容的错误:

<type 'exceptions.AttributeError'>:'module'对象没有'kill'属性
      args = ("'module'对象没有'kill'属性",)
      message = "'module'对象没有'kill'属性"
英文:

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&quot;
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 &quot;PIL&quot; 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] &quot;GET / HTTP/1.1&quot; 200 -
INFO     2012-07-28 12:32:38,588 dev_appserver.py:2952] &quot;GET /favicon.ico HTTP/1.1&quot; 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] &quot;GET / HTTP/1.1&quot; 200 -
INFO     2012-07-28 12:32:56,694 dev_appserver.py:2952] &quot;GET /favicon.ico HTTP/1.1&quot; 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:

&lt;type &#39;exceptions.AttributeError&#39;&gt;: &#39;module&#39; object has no attribute &#39;kill&#39; 
      args = (&quot;&#39;module&#39; object has no attribute &#39;kill&#39;&quot;,) 
      message = &quot;&#39;module&#39; object has no attribute &#39;kill&#39;&quot;

huangapple
  • 本文由 发表于 2012年7月3日 09:49:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/11303481.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定