我正试着从维基百科上搜刮文字。既然httplib2已经安装,我想我会使用它。在
当我从他们的basic examples进行简单的检索时,第一个示例给出了这个错误。在> import httplib2
> h = httplib2.Http(".cache")
> url = "http://code.google.com/p/httplib2/"
> h.request(url, "GET")
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.py", line 978, in request
cached_value = self.cache.get(cachekey)
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.py", line 625, in get
cacheFullPath = os.path.join(self.cache, self.safe(key))
File "/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/httplib2/__init__.py", line 189, in safename
filemd5 = md5.new(filename).hexdigest()
AttributeError: 'builtin_function_or_method' object has no attribute 'new'
我在macosx上运行,Python版本:7.2-2(64位),热情的发行版。在
我在想这可能是安装错误的问题,但后来httplib2再次与我一直使用的其他包一起安装。另外,我可以尝试重新安装httplib2,但我犹豫是否要这样做,因为我认为它可能会破坏其他正在运行的东西。在