requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

Error in if requests.__version__ < '2.0.0'

Open entchen66 opened this issue 5 years ago • 2 comments

Hey there, anyone ever got an Error like this:

File "/discord_bot/redbot/cogs/Downloader/lib/twitter/api.py", line 31, in <module> from requests_oauthlib import OAuth1, OAuth2 File "/discord_bot/redbot/cogs/Downloader/lib/requests_oauthlib/__init__.py", line 11, in <module> if requests.__version__ < '2.0.0': TypeError: '<' not supported between instances of 'module' and 'str'

I have no clue whats the problem. Maybe someone can help me ;)

entchen66 avatar Jun 03 '19 22:06 entchen66

I also saw this same error and managed to resolve it with the following:

python3 -m pip uninstall requests-oauthlib
sudo rm -rf /usr/local/lib/python3.6/dist-packages/requests_oauthlib/
sudo rm -rf /usr/local/lib/python3.6/dist-packages/requests_oauthlib-1.3.0.dist-info/
python3 -m pip install --upgrade pip
python3 -m pip install requests-oauthlib

on Debian/Ubuntu and note that the package version is hard-coded in one line, here 1.3.0

it was a weird error because it appeared to only sporadically occur.

winedarksea avatar Jan 07 '21 19:01 winedarksea

Would you notice me an error effect?it seems requests version check only (2.0.0) and I currently uses 2.23.0. I am comment out the following code tentatively.

/usr/local/lib/python3.6/dist-packages/requests_oauthlib/__init__.py

#if requests.__version__ < "2.0.0":
#    msg = (
#        "You are using requests version %s, which is older than "
#        "requests-oauthlib expects, please upgrade to 2.0.0 or later."
#    )
#    raise Warning(msg % requests.__version__)

sakaia avatar Jan 25 '21 00:01 sakaia