GAE“没有属性'HTTPSHandler'”dev_appserver.py

时间:2010-09-11 12:13:18

标签: python linux google-app-engine

我正在尝试使用我的ubuntu lucid中的google appengine python SKD。我已经编译了python2.5。但是当我用它执行任何“dev_appserver.py”命令时,我收到以下错误:

 Traceback (most recent call last):
  File "dev_appserver.py", line 69, in <module>
    run_file(__file__, globals())
  File "dev_appserver.py", line 65, in run_file
    execfile(script_path, globals_)
  File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 90, in <module>
    from google.appengine.tools import appcfg
  File "/media/Ultimate/WebD/django/app_engine/google_appengine/google/appengine/tools/appcfg.py", line 59, in <module>
    from google.appengine.tools import appengine_rpc
  File "/media/Ultimate/WebD/django/app_engine/google_appengine/google/appengine/tools/appengine_rpc.py", line 24, in <module>
    import fancy_urllib
  File "/media/Ultimate/WebD/django/app_engine/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 328, in <module>
    class FancyHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'

我已经检查了python2.6和python2.5的urllib2模块,但模型定义没有区别,而且python2.5中也存在HTTPSHandelr。所以我想这是另一种错误。

我试图使用默认的python2.6运行,但后来我收到以下错误:

WARNING  2010-09-11 12:08:40,848 datastore_file_stub.py:657] Could not read datastore data from /tmp/dev_appserver.datastore
Traceback (most recent call last):
  File "./dev_appserver.py", line 69, in <module>
    run_file(__file__, globals())
  File "./dev_appserver.py", line 65, in run_file
    execfile(script_path, globals_)
  File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 449, in <module>
    sys.exit(main(sys.argv))
  File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 426, in main
    static_caching=static_caching)
  File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver.py", line 3820, in CreateServer
    server = HTTPServerWithScheduler((serve_address, port), handler_class)
  File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver.py", line 3840, in __init__
    request_handler_class)
  File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
    self.server_bind()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
    self.socket.bind(self.server_address)
  File "<string>", line 1, in bind
socket.error: [Errno 98] Address already in use

它在窗户甚至是葡萄酒中都很好用。

更新
解决了python2.6的问题 我曾经在8080和80端口上配置了我的apache服务器以进行django部署。

但是python2.5 isntallation仍然存在同样的错误。

3 个答案:

答案 0 :(得分:3)

解决了这个问题...只需要使用:

构建python的所有依赖项
  

apt-get build-dep python

即使没有安装所有依赖项,

python也没有错误编译。它只是跳过需要它们的模块并构建python。

答案 1 :(得分:2)

缺少HTTPSHandler的解决方案:

在从源代码构建python 2.5之前,您需要通过编辑Modules / Setup.dist来启用ssl-socket(更多信息请参见http://paltman.com/2007/nov/15/getting-ssl-support-in-python-251/

答案 2 :(得分:1)

本文中描述的方法对我来说非常有效(Ubuntu 11.10)。

http://dewbot.posterous.com/installation-of-python-25-and-google-app-engi