admin管理员组

文章数量:1125546

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?

本文标签: pythonPygooglenews import failureStack Overflow