【发布时间】:2012-02-20 09:43:37
【问题描述】:
我正在尝试使用 feedparser 解析 RSS 提要。为简洁起见,以下代码被截断
from google.appengine.api import urlfetch
import feedparser
print 'Content-Type: text/plain'
feed_url = 'http://parsethisurl'
feedinput = urlfetch.fetch(feed_url)
rss_parsed = feedparser.parse(feedinput.content)
......
#some logic here
.........
print "\n".join(episode_info) # printing out the desired output.
在我的 python 解释器上运行良好,但是当我将应用程序添加到 gapp 引擎启动器并尝试通过 localhost:10000 运行它时,它给了我以下错误
<type 'exceptions.ImportError'>: No module named feedparser
args = ('No module named feedparser',)
message = 'No module named feedparser'
feedparser 模块已经安装在我的系统上。
>>> sys.version
'2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]'
>>> import feedparser
>>>
我阅读了一些关于 stackoveflow 的文章和 feedparser 不能直接在 gapp 引擎上工作的博客。我听从了建议并使用了urlfetch.fetch(feed_url),但我也遇到了错误。
PS:gapp 启动器上的 PythonPath 是 C:\Python25\python.exe
【问题讨论】:
标签: python google-app-engine feedparser python-2.5