Forums

Cannot get pygooglenews module working

I finally got the install to complete - and now when importing the module it is still not recognized. I am using Python 3.10 and pygooglenews is listed on pip list - but when "from pygooglenews import GoogleNews" it is saying that it is not recognized and is giving two feedparser errors. Has anyone successfully installed this module and used it on pythonanywhere?

Could you provide the full error message?

Traceback (most recent call last): File "/home/kevinstanley/python/news_scraper/google_news.py", line 1, in <module> from pygooglenews import GoogleNews File "/home/kevinstanley/.local/lib/python3.10/site-packages/pygooglenews/init.py", line 1, in <module> import feedparser File "/home/kevinstanley/.local/lib/python3.10/site-packages/feedparser.py", line 316 raise KeyError, "object doesn't have key 'category'" ^ SyntaxError: invalid syntax

I resolved this by updating my feedparser version from 5.1 to 6.0

OK, glad to hear you got it working!