带有Google应用程序引擎的Python。attribute error:“module”对象没有属性“HTTPSHandler”error messag

2024-05-15 14:06:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我是Python新手,目前正在学习Head First Python一书。我试着用一个例子练习,但我被来自GAE的一个错误卡住了。 我在Kubuntu 10.10s.O上安装了Python 2.5和GAE

首先,我创建一个名为“mygaetest”的文件夹,其中包含文件sayhello.py和app.yaml。 因为Linux没有图形前端,所以我从命令行启动GAE webapp:

python2.5 google_appengine/dev_appserver.py home/lucas/workspace/Python/Chapter10/src/mygaetest/

但随后显示以下错误:

Traceback (most recent call last):

File "google_appengine/dev_appserver.py", line 78, in

run_file(__file__, globals())

File "google_appengine/dev_appserver.py", line 74, in run_file

execfile(script_path, globals_)

File "/home/lucas/Desarrollo/Python/App

Engine/google_appengine/google/appengine/tools/dev_appserver_main.py", line 118, in

from google.appengine.tools import appcfg

File "/home/lucas/Desarrollo/Python/App

Engine/google_appengine/google/appengine/tools/appcfg.py", line 68, in

from google.appengine.tools import appengine_rpc

File "/home/lucas/Desarrollo/Python/App

Engine/google_appengine/google/appengine/tools/appengine_rpc.py", line 27, in

import fancy_urllib

File "/home/lucas/Desarrollo/Python/App

Engine/google_appengine/lib/fancy_urllib/fancy_urllib/init.py", line 341, in

class FancyHTTPSHandler(urllib2.HTTPSHandler):

AttributeError: 'module' object has no attribute 'HTTPSHandler'

有人能告诉我怎么做才能解决这个错误吗?

多谢提前。


Tags: inpydevapphomegooglelinetools
3条回答

我使用的是Python2.7,我使用了以下说明来解决问题: http://paltman.com/2007/11/15/getting-ssl-support-in-python-251/

我在将Mac OSX升级到10.10(Yosemite)后收到这个错误,我需要python的新版本2.7

$ brew update && brew upgrade python
==> Upgrading 1 outdated package, with result:
python 2.7.8_2
==> Upgrading python
...
==> Summary
/usr/local/Cellar/python/2.7.8_2: 4777 files, 76M

欢迎使用Python、App Engine和Stack Overflow!

您的Python安装显然缺少SSL支持。要添加支持,install this

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

相关问题 更多 >