OJT
OJT

Reputation: 899

Pygooglenews import failure

I have the following versions installed:

Name: pygooglenews
Version: 0.1.3
Name: feedparser
Version: 6.0.11

Nevertheless, when I try to import pygooglenews, I get the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-7a5a1e5c2c1c> in <module>
----> 1 from pygooglenews import GoogleNews

~/venv/lib/python3.9/site-packages/pygooglenews/__init__.py in <module>
----> 1 import feedparser
      2 from bs4 import BeautifulSoup
      3 import urllib
      4 from dateparser import parse as parse_date
      5 import requests

~/venv/lib/python3.9/site-packages/feedparser.py in <module>
     91 else:
     92     # Python 3.1 deprecates decodestring in favor of decodebytes
---> 93     _base64decode = getattr(base64, 'decodebytes', base64.decodestring)
     94 
     95 # _s2bytes: convert a UTF-8 str to bytes if the interpreter is Python 3

AttributeError: module 'base64' has no attribute 'decodestring'

Is there a workaround for this?

Upvotes: 0

Views: 38

Answers (1)

dev_light
dev_light

Reputation: 4096

pygooglenews 0.1.3 only supports Python 3.12 and 3.13. There's no support for python3.9 (your version). Upgrade to a supported version to use this library.

Upvotes: 0

Related Questions