google app engine 中import yaml问题的解决

This item was filled under [ 一步一步学习中 ]

转自:http://bluedusk.javaeye.com/blog/341832

通过代理上传Google App Engine 应用

这个是Google app engine的一个issue:

Seems to be no support for proxy in appcfg.py

http://code.google.com/p/googleappengine/issues/detail?id=126

解决方案:[Windows]

1、在命令行中Set evironment variables:

set http_proxy=http://proxy.blah.com.au:3128

set https_proxy=https://proxy.blah.com.au:31

C:\PROGRA~1\Google\GOOGLE~3>set https_proxy=https://proxy.blah.com.au:3128/

http_proxy=http://proxy.blah.com.au:3128/

2、下载Change the appcfg.py file:

http://googleappengine.googlecode.com/issues/attachment?aid=-622907771208491476&name=appcfg.py

替换掉:

C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py

appcfg.py

59.6 KB Download

3、如果替换后出现如下错误:

I replaced the appcfg.py file and now i get this error…

Traceback :

File “C:\Program Files\Google\google_appengine\appcfg.py”, line 53, in

from google.appengine.api import appinfo

File “C:\Program Files\Google\google_appengine\google\appengine\api\appinfo.py”,

line 31, in

from google.appengine.api import validation

File “C:\Program Files\Google\google_appengine\google\appengine\api\validation.py”,

line 44, in

import yaml

ImportError: No module named yaml

就要安装yaml:

C:\Program Files\Google\google_appengine\lib\yaml>python setup.py install

[To solve the yaml trouble you have to install yaml, as described in

\lib\yaml\README]

4、如果还有认证的问题:

Then to solve the authenticated proxy trouble, I used the arthurfreeman’s appcfg.py

and I’ve tried to modify it according to elspoono suggestion, but I still had

troubles with my corporate NTLM authenticated proxy, then I’ve installed and

configured ntlmaps proxy and finally solved! (using the original arthurfreeman’s

appcfg.py)

http://ntlmaps.sourceforge.net/

This Python proxy hides every issue about authenticated NTLM proxy, before running it

you have to input some infos in server.cfg file:

- port for ntlmaps listener

- your real proxy address

- your real proxy authentication domain/account/password

- your machine’s nt_hostname

- friendly ips (in this case your machine ip)

Then , running the ntlmaps proxy on port 5865, I’ve configured the environment

variables in this way:

set https_proxy=https://localhost:5865

set http_proxy=http://localhost:5865

and finally succeed in uploading my first application in google app engine!

5、这下该可以了吧!!:)

Bookmark and Share