2010年4月24日土曜日

GAEでurllibがエラーする

GAEのデバッグモードにてurllibを使って簡単にurlopenしようと思ったらエラーするのでメモ。
・環境
OS:MacOSX 10.6.2
GAE:1.3.3
python:2.6.1
でエラー内容がこれ
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 511, in __call__
handler.get(*groups)
File "/Users/mmiyaji/MJ/applications/appengine/islabs/main.py", line 43, in get
twit = get_twit()
File "/Users/mmiyaji/MJ/applications/appengine/islabs/utility.py", line 21, in get_twit
f = urllib.urlopen(twit_url)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 82, in urlopen
opener = FancyURLopener()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 611, in __init__
URLopener.__init__(self, *args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 129, in __init__
proxies = getproxies()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 1558, in getproxies
return getproxies_environment() or getproxies_macosx_sysconf()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 1448, in getproxies_macosx_sysconf
from ctypes import cdll
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1279, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1929, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1279, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1831, in FindAndLoadModule
description)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1279, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1782, in LoadModuleRestricted
description)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 10, in
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes

とりあえずpython2.6の環境でurllibがちゃんと動くか怪しかったので2.5で起動してみる。
python2.5 /usr/local/bin/dev_appserver.py --address=0.0.0.0 --port=8089 hogehoge
動いた。GAEが っていうかpython2.6のエラーでしたね

0 件のコメント:

コメントを投稿