kurtmckee/feedparser

feedparser 5.x is running when 6.0.8 appears to be installed

kurtmckee opened this issue · 6 comments

Issue opened to troubleshoot an issue reported in #201.

Running the pygooglenews library that lists feedparser 5.2.1 as a dependency resulting in the AttributeError: module 'base64' has no attribute 'decodestring' error when running python 3.9

Library owner is inactive and won't merge the fix opened on his code.

Tried uninstalling feedparseer (FP) 5.x and piping the latest 6.0.8 build and still getting the same error. Python also mentions pygooglenews 0.1.2 requires feedparser<6.0.0,>=5.2.1, but you have feedparser 6.0.8 which is incompatible..

Great, that answers a question I was typing.

You can fix this by cloning the repository (or downloading and extracting code from their git repo) and running commands like these to build a modified version. I'm assuming a Linux environment with git already installed, but the commands should mostly work in Powershell as well, perhaps with some modifications. Note that I don't exactly remember all of the virtual environment paths for each environment I list below so you might have to use tab completion to get to the right path and capitalization.

git clone https://github.com/kotartemiy/pygooglenews.git
cd pygooglenews
python -m venv venv

# Bash
source venv/bin/activate

# Powershell
& venv/Scripts/Activate.ps1

# cmd.exe
venv\Scripts\Activate.bat

# Install poetry.
python -m pip install poetry

# Update the dependencies.
poetry update

# Build a new source package for pygooglenews.
poetry build

(Remember to close that console session so that you're not still working in that virtual environment!)

Now you should see some files in the build/ directory, which should have new feedparser dependencies listed.

Copy that updated .tar.gz or .whl file to wherever you were installing pygooglenews from, then you can run pip to install that updated version:

python -m pip install --upgrade pygooglenews-filename.whl

By the way, if that resolves the problem I recommend submitting a merge request to pygooglenews with the updated pyproject.toml and poetry.lock files. That may make it easier on the author, and it'll help others, too!

let me wrap my head around that one for a bit. I'll come back to you when I'll realise my skill is far under all of that :P

By the way, if that resolves the problem I recommend submitting a merge request to pygooglenews with the updated pyproject.toml and poetry.lock files. That may make it easier on the author, and it'll help others, too!

Yea, a fix has already been submitted but the owner is inactive :(

my skill is far under all of that

No worries, I think this will be a great learning opportunity, and I'm very sure you have the skills to overcome this! 👍

The only requirement is to re-build the pygooglenews file that pip installs so that it depends on feedparser 6. The commands I provided above are designed to accomplish that in a virtual environment so that your global Python packages aren't affected.

Please respond back if you encounter any difficulties with the commands above. I'm going to close this issue.