pytrends
pytrends copied to clipboard
Requests version conflicts?
In the newer version of Requests(for me it's 2.30.0), it looks like Retry
method no longer has the argument method_whitelist
. I've got an error like
retry = Retry(total=self.retries, read=self.retries,
TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'
According to https://stackoverflow.com/questions/65289720/attributeerror-retry-object-has-no-attribute-method-whitelist
The thing is that method_whitelist was deprecated and removed from urllib3==1.26.0 onwards
Also in pytrends/request.py
, the import of retry is not valid to IDE in the newer version of urllib3.
Looks like from requests.packages.urllib3.util.retry import Retry
should be from urllib3.util import Retry
now
Just bumped into this. URLlib 3 indeed made that change and pretty much broke this whole library. Any chance someone (@Terseus ) can merge this PR https://github.com/GeneralMills/pytrends/pull/584/commits/cfb9d54518349b67086afb83afa380bc255eaedb ?
Sorry @im-n1 but there's a bug in vcrpy that prevents the test suite to work with urllib3 v2, you can follow the problem in the PR: https://github.com/GeneralMills/pytrends/pull/584#issuecomment-1596226007
I wonder if there are any updates? Or is there a way for temporary workaround?
Hi @im-n1,
Sorry, but Real Life™ keeps me busy right now, I'll try this weekend to check if https://github.com/kevin1024/vcrpy/issues/719 made any difference, or what can we do about this.
For now the workaroud is to pin urllib3<2
in your requirements.
For now the workaroud is to pin urllib3<2 in your requirements.
works thanks