0

I have the feedparser.py in my project directory but my code does not work on the local google dev server for google app engine.

I get this error,

  File "/home/ahmad/GAE/livemetals/lv.py", line 34, in <module>
    d = feedparser.parse(url)
AttributeError: 'module' object has no attribute 'parse'
INFO     2012-06-23 16:13:25,891 dev_appserver.py:2891] "GET / HTTP/1.1" 500 -

this is the code i'm using

url = "http://www.mysite.com"

d = feedparser.parse(url)
articles = {}
for row in d.entries:
    temp = [row['link'].encode('utf-8'),row['title'].encode('utf-8'),row['summary'].encode('utf-8')]
    articles.append(temp)

I can use feedparser on a non-google app engine python script. However when i copy "feedparser.py" i still can't get it to work in my project even though i import it as folows

import feedparser

How do I get feedparser to work in my GAE project? thanks for the help

user772401
  • 2,754
  • 3
  • 31
  • 50

1 Answers1

1

It seems to me that the GAE python runtime is finding another feedparser module.
Do you have another feedparser.py script in your project?
I would try to print the feedparser.__file__ to check where the module your project is pointing to.

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • I tried that and I get this, /home/ahmad/GAE/livemetals/feedparser/__init__.py so it is pointing to my current project directory – user772401 Jun 23 '12 at 16:35
  • 1
    oh nvm, I had a folder called "feedparser", i just deleted it and now its pointing to /home/ahmad/GAE/livemetals/feedparser.py and i don't get my error! Thanks for your help, it worked! – user772401 Jun 23 '12 at 16:37