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

TypeError: __init__() got an unexpected keyword argument 'allowed_methods' #143

Open
derary66 opened this issue Feb 5, 2023 · 8 comments

Comments

@derary66
Copy link

derary66 commented Feb 5, 2023

Describe the bug
yahooquery version: 2.3.0
Error message:
TypeError: init() got an unexpected keyword argument 'allowed_methods'.

To Reproduce
Steps to reproduce the behavior:
from yahooquery import Ticker
stock = Ticker('AAPL')

Expected behavior
Work properly as before.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10 Professional
  • Browser [e.g. chrome, safari]: Microsoft Edge, Anaconda Spyder (2021.11)
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@derary66
Copy link
Author

derary66 commented Feb 5, 2023

I also tries other releases of yahooquery: 2.2.15, same error message.

@derary66
Copy link
Author

derary66 commented Feb 5, 2023

I also tries other releases of yahooquery: 2.2.14, error message disappeared, function properly:-)

@dpguthrie
Copy link
Owner

Looks like a problem with the requests dependency (anything less than 2.25.0 will have an older version of urllib3 that is looking for method_whitelist instead of allowed_methods). I'll update the package to include the appropriate version, but you should be able to get around it by upgrading requests:

pip install requests --upgrade

@juskek
Copy link

juskek commented Feb 18, 2023

Got the same error with the following env:

Google CoLab

Packages:

Name: yahooquery
Version: 2.3.0
Name: requests
Version: 2.28.2
Name: urllib3
Version: 1.26.14

@austin-stocks
Copy link

austin-stocks commented Feb 19, 2023

I have the same issue while running simple code snippet

from yahooquery import Ticker
...
...
aapl = Ticker('aapl')

Output:

allowed_methods=["HEAD", "GET", "OPTIONS", "POST", "TRACE"],

TypeError: init() got an unexpected keyword argument 'allowed_methods'

Packages:

yahooquery == 2.3.0
requests == 2.28.2
urlibs3 == 1.27

@dpguthrie
Copy link
Owner

@juskek Do you have the notebook example? I have the same versions you specified above and don't run into this issue:

image

@jwm1969
Copy link

jwm1969 commented Feb 20, 2023

I have the same issue with:

requests 2.28.2
urllib3 1.26.14
yahooquery 2.3.0

let me know if i can provide additional debugging

UPDATE: i did in fact have an older version of urllib3 in another path that was being loaded. i manually removed it and issue is fixed.

@austin-stocks
Copy link

It is working for me now. urllibs3 version was not upto date for me.
yahooquery1
yahooquery2

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