Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将feedparser与googleappengine结合使用_Python_Google App Engine_Feedparser_Python 2.5 - Fatal编程技术网

Python 将feedparser与googleappengine结合使用

Python 将feedparser与googleappengine结合使用,python,google-app-engine,feedparser,python-2.5,Python,Google App Engine,Feedparser,Python 2.5,我正在尝试用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

我正在尝试用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'
我在stackoveflow和博客上读到了一些文章,这些文章认为feedparser不能直接在gapp引擎上工作。我按照建议使用了
urlfetch.fetch(feed\u url)
,但同时也出现了一个错误


PS:gapp启动器上的PythonPath是
C:\Python25\python.exe

您已经在本地安装了
feedparser
,所以当您在开发服务器上运行应用程序时,它可以正常工作。但是为了在生产中使用
feedparser
,您需要将其包含在项目中,因为GAE不为您提供此库

您需要将
feedparser
与项目文件一起上传。为此,您可以将其复制到应用程序根目录中,然后部署应用程序

>>> sys.version
'2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]'
>>> import feedparser
>>>