Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base 64 deprecation #12

Open
NilaiVemula opened this issue Dec 6, 2020 · 10 comments
Open

base 64 deprecation #12

NilaiVemula opened this issue Dec 6, 2020 · 10 comments

Comments

@NilaiVemula
Copy link

This package depends on feedparser, which has an error in this section of feedparser.py (line 91):

# Python 3.1 deprecates decodestring in favor of decodebytes
_base64decode = getattr(base64, 'decodebytes', base64.decodestring)

This has been deprecated since Python 3.1, but it was completely removed in Python 3.9. This makes it unable to import.

@tirkarthi
Copy link

This has been fixed in feedparser : kurtmckee/feedparser#206

@Pyth3rEx
Copy link

Pyth3rEx commented Aug 15, 2021

This has been fixed in feedparser : kurtmckee/feedparser#206

Indeed, but my pygooglenews forces me to use the old version of feedparser, it won't start with the new one and the old one gives me the depreciated issue. Looking for a fix

pygooglenews 0.1.2 requires feedparser<6.0.0,>=5.2.1, but you have feedparser 6.0.8 which is incompatible.

File "---", line 4, in <module>
    from pygooglenews import GoogleNews
  File "---", line 1, in <module>
    import feedparser
  File "---", line 93, in <module>
    _base64decode = getattr(base64, 'decodebytes', base64.decodestring)
AttributeError: module 'base64' has no attribute 'decodestring'

@Alyetama
Copy link

You need to update feedparser:

pip install -U --no-deps "feedparser>=6.0.8"

Side note: dateparser is also outdated, so I recommend updating it as well:

pip install -U --no-deps "dateparser>=1.0.0"

@Pyth3rEx
Copy link

Using this technique allowed me to install the latest feedparser indeed, but my enviroment dosn't seem to reconise it as I get the following error. I am unsure as to why this is happening as it shows up correctl in 'pip list'
ModuleNotFoundError: No module named 'feedparser'

@Alyetama
Copy link

Alyetama commented Aug 20, 2021

Using this technique allowed me to install the latest feedparser indeed, but my enviroment dosn't seem to reconise it as I get the following error. I am unsure as to why this is happening as it shows up correctl in 'pip list'
ModuleNotFoundError: No module named 'feedparser'

Can you post the full error traceback and the output of:

$ which pip
$ pip show feedparser

@Pyth3rEx
Copy link

(base) C:\Users\Pyth3rEx>which pip
'which' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

(base) C:\Users\Pyth3rEx>pip show feedparser
Name: feedparser
Version: 6.0.8
Summary: Universal feed parser, handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Home-page: https://github.com/kurtmckee/feedparser
Author: Kurt McKee
Author-email: contactme@kurtmckee.org
License: BSD-2-Clause
Location: c:\users\pyth3rex\anaconda3\lib\site-packages
Requires: sgmllib3k
Required-by: pygooglenews

Notice that the first issue means that 'which' is not reconised as a command.

@Alyetama
Copy link

which is a unix command, so that's normal since you're on windows. I suspect that you are running the program on a different python installation than the one in your anaconda environment. To check if this is the case, open Anaconda with the Start Menu and select Anaconda Prompt, type python and press Enter. Then try importing the package from there import feedparser.

Are you using PyCharm, VS Code, or Sublime Text, etc.? If you are, then find out how to set your Anaconda Python installation as your interpreter (or "build" if you use sublime text).

@Pyth3rEx
Copy link

Feedparsr is correctly installed (due to the pip show command) but when importing gets me the error No module named 'feedparser'

@Pyth3rEx
Copy link

Found a temporary fix:
py -3.8 <file.py>
Not that I use the -3.8 parameter since I have it installed, but for people reading this to find a fix, just use any version you have intalled (eg. -3.6; -2.6... or whatever)
Also note that the py command comes packed with python 3.5 and above, for other versions you'll have to get pylauncher for yourself.

@ranjan-ankit
Copy link

Try this, it just worked for me now:

!pip install "setuptools<58"
!pip install -U --no-deps "dateparser>=1.0.0"
!pip install -U --no-deps "feedparser>=6.0.8"
!pip install pygooglenews==0.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants