前回の予告通り「「Google App EngineでHello World!! + ローカルLinux環境」をやっていて出たエラーの Q & A」です。
Q 1 Pythonをconfigureするときにエラーになる。
$ ./configure --prefix=/home/google/ll/py/
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
A 1
gccをインストールしましょう。
CentOSなら以下のコマンドでインストールされます。
# yum install gcc
手動でインストールする場合に必要なパッケージは以下になります。
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
gcc i386 4.1.2-14.el5 base 5.2 M
Installing for dependencies:
glibc-devel i386 2.5-18.el5_1.1 updates 2.0 M
glibc-headers i386 2.5-18.el5_1.1 updates 609 k
kernel-headers i386 2.6.18-53.1.14.el5 updates 786 k
libgomp i386 4.1.2-14.el5 base 76 k
Updating for dependencies:
glibc i686 2.5-18.el5_1.1 updates 5.1 M
glibc-common i386 2.5-18.el5_1.1 updates 16 M
Transaction Summary
=============================================================================
Install 5 Package(s)
Update 2 Package(s)
Remove 0 Package(s)
Q 2 webサーバーが立ち上がらない。
$ python google_appengine/dev_appserver.py hello/
Traceback (most recent call last):
File "google_appengine/dev_appserver.py", line 50, in <module>
execfile(script_path, globals())
File "/home/google/google_appengine/google/appengine/tools/dev_appserver_main.py", line 338, in <module>
sys.exit(main(sys.argv))
File "/home/google/google_appengine/google/appengine/tools/dev_appserver_main.py", line 297, in main
server = MakeRpcServer(option_dict)
File "/home/google/google_appengine/google/appengine/tools/dev_appserver_main.py", line 259, in MakeRpcServer
host_override=option_dict[ARG_ADMIN_CONSOLE_HOST])
File "/home/google/google_appengine/appcfg.py", line 114, in __init__
File "/home/google/google_appengine/appcfg.py", line 319, in _GetOpener
AttributeError: 'module' object has no attribute 'HTTPSHandler'
A 2
Pythonをインストール時、以下のファイルを修正します。
./counfigureの実行後、makeの前に [ Modules/Setup ]を以下のように修正します。
#SSL=/usr/local/ssl
#_ssl _ssl.c \
# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
# -L$(SSL)/lib -lssl -lcrypto
+ SSL=/usr
+ _ssl _ssl.c \
+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+ -L$(SSL)/lib -lssl -lcrypto
Q 3 Pythonをmakeするときエラーになる
./Modules/_ssl.c: In function 'init_ssl':
./Modules/_ssl.c:693: 警告: implicit declaration of function 'SSL_load_error_strings'
./Modules/_ssl.c:694: 警告: implicit declaration of function 'SSLeay_add_ssl_algorithms'
make: *** [Modules/_ssl.o] エラー 1
A 3
openssl-devel をインストールしましょう。
CentOSなら以下のコマンドでインストールされます。
# yum install openssl-devel
手動でインストールする場合に必要なパッケージは以下になります。
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
openssl-devel i386 0.9.8b-8.3.el5_0.2 base 1.8 M
Installing for dependencies:
e2fsprogs-devel i386 1.39-10.el5_1.1 updates 563 k
keyutils-libs-devel i386 1.2-1.el5 base 27 k
krb5-devel i386 1.6.1-17.el5_1.1 updates 1.9 M
libselinux-devel i386 1.33.4-4.el5 base 131 k
libsepol-devel i386 1.15.2-1.el5 base 189 k
zlib-devel i386 1.2.3-3 base 101 k
Updating for dependencies:
e2fsprogs i386 1.39-10.el5_1.1 updates 960 k
e2fsprogs-libs i386 1.39-10.el5_1.1 updates 114 k
krb5-libs i386 1.6.1-17.el5_1.1 updates 652 k
krb5-workstation i386 1.6.1-17.el5_1.1 updates 869 k
Transaction Summary
=============================================================================
Q 4 Google App Engineにアップロードできない
$ python ~/google_appengine/appcfg.py update ~/hello/
2008-04-22 21:00:44,926 ERROR __init__.py:1294 An unexpected error occurred. Aborting.
Traceback (most recent call last):
File "/home/google/google_appengine/appcfg.py", line 48, in <module>
execfile(script_path, globals())
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1532, in <module>
main(sys.argv)
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1528, in main
AppCfgApp(argv).Run()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1203, in Run
self.action.function(self)
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1407, in Update
lambda path: open(os.path.join(basepath, path), "rb"))
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1051, in DoUpload
missing_files = self.Begin()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 912, in Begin
version=self.version, payload=self.config.ToYAML())
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 266, in Send
self._Authenticate()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 303, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 214, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 159, in _GetAuthToken
response = self.opener.open(req)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 381, in open
response = self._open(req, data)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 399, in _open
'_open', req)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 1115, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 1082, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (111, 'Connection refused')>
A 4 未解決
たぶんproxyが原因なんですが解決方法を調べていません。時間ができたら調べるつもりです。(できるのであればProxyをはずしてやってみてください。)
以上で終わりです。
$ ./configure --prefix=/home/google/ll/py/
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
A 1
gccをインストールしましょう。
CentOSなら以下のコマンドでインストールされます。
# yum install gcc
手動でインストールする場合に必要なパッケージは以下になります。
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
gcc i386 4.1.2-14.el5 base 5.2 M
Installing for dependencies:
glibc-devel i386 2.5-18.el5_1.1 updates 2.0 M
glibc-headers i386 2.5-18.el5_1.1 updates 609 k
kernel-headers i386 2.6.18-53.1.14.el5 updates 786 k
libgomp i386 4.1.2-14.el5 base 76 k
Updating for dependencies:
glibc i686 2.5-18.el5_1.1 updates 5.1 M
glibc-common i386 2.5-18.el5_1.1 updates 16 M
Transaction Summary
=============================================================================
Install 5 Package(s)
Update 2 Package(s)
Remove 0 Package(s)
Q 2 webサーバーが立ち上がらない。
$ python google_appengine/dev_appserver.py hello/
Traceback (most recent call last):
File "google_appengine/dev_appserver.py", line 50, in <module>
execfile(script_path, globals())
File "/home/google/google_appengine/google/appengine/tools/dev_appserver_main.py", line 338, in <module>
sys.exit(main(sys.argv))
File "/home/google/google_appengine/google/appengine/tools/dev_appserver_main.py", line 297, in main
server = MakeRpcServer(option_dict)
File "/home/google/google_appengine/google/appengine/tools/dev_appserver_main.py", line 259, in MakeRpcServer
host_override=option_dict[ARG_ADMIN_CONSOLE_HOST])
File "/home/google/google_appengine/appcfg.py", line 114, in __init__
File "/home/google/google_appengine/appcfg.py", line 319, in _GetOpener
AttributeError: 'module' object has no attribute 'HTTPSHandler'
A 2
Pythonをインストール時、以下のファイルを修正します。
./counfigureの実行後、makeの前に [ Modules/Setup ]を以下のように修正します。
#SSL=/usr/local/ssl
#_ssl _ssl.c \
# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
# -L$(SSL)/lib -lssl -lcrypto
+ SSL=/usr
+ _ssl _ssl.c \
+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+ -L$(SSL)/lib -lssl -lcrypto
Q 3 Pythonをmakeするときエラーになる
./Modules/_ssl.c: In function 'init_ssl':
./Modules/_ssl.c:693: 警告: implicit declaration of function 'SSL_load_error_strings'
./Modules/_ssl.c:694: 警告: implicit declaration of function 'SSLeay_add_ssl_algorithms'
make: *** [Modules/_ssl.o] エラー 1
A 3
openssl-devel をインストールしましょう。
CentOSなら以下のコマンドでインストールされます。
# yum install openssl-devel
手動でインストールする場合に必要なパッケージは以下になります。
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
openssl-devel i386 0.9.8b-8.3.el5_0.2 base 1.8 M
Installing for dependencies:
e2fsprogs-devel i386 1.39-10.el5_1.1 updates 563 k
keyutils-libs-devel i386 1.2-1.el5 base 27 k
krb5-devel i386 1.6.1-17.el5_1.1 updates 1.9 M
libselinux-devel i386 1.33.4-4.el5 base 131 k
libsepol-devel i386 1.15.2-1.el5 base 189 k
zlib-devel i386 1.2.3-3 base 101 k
Updating for dependencies:
e2fsprogs i386 1.39-10.el5_1.1 updates 960 k
e2fsprogs-libs i386 1.39-10.el5_1.1 updates 114 k
krb5-libs i386 1.6.1-17.el5_1.1 updates 652 k
krb5-workstation i386 1.6.1-17.el5_1.1 updates 869 k
Transaction Summary
=============================================================================
Q 4 Google App Engineにアップロードできない
$ python ~/google_appengine/appcfg.py update ~/hello/
2008-04-22 21:00:44,926 ERROR __init__.py:1294 An unexpected error occurred. Aborting.
Traceback (most recent call last):
File "/home/google/google_appengine/appcfg.py", line 48, in <module>
execfile(script_path, globals())
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1532, in <module>
main(sys.argv)
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1528, in main
AppCfgApp(argv).Run()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1203, in Run
self.action.function(self)
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1407, in Update
lambda path: open(os.path.join(basepath, path), "rb"))
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 1051, in DoUpload
missing_files = self.Begin()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 912, in Begin
version=self.version, payload=self.config.ToYAML())
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 266, in Send
self._Authenticate()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 303, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 214, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "/home/google/google_appengine/google/appengine/tools/appcfg.py", line 159, in _GetAuthToken
response = self.opener.open(req)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 381, in open
response = self._open(req, data)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 399, in _open
'_open', req)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 1115, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/home/google/ll/py//lib/python2.5/urllib2.py", line 1082, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (111, 'Connection refused')>
A 4 未解決
たぶんproxyが原因なんですが解決方法を調べていません。時間ができたら調べるつもりです。(できるのであればProxyをはずしてやってみてください。)
以上で終わりです。
Leave a comment