问题
I installed quandl using pip. I imported it and tried it:
import quandl
mydata = quandl.get("FRED/GDP")
print(df.head())
This resulted in the error below. Any suggestions how to solve it?
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-a47ca7d841f3> in <module>()
1 import quandl
2 #df = quandl.get("SSE/SVHG")
----> 3 mydata = quandl.get("FRED/GDP")
4 #mydata = quandl.get("DATABASE_CODE2/DATASET_CODE2")
5 print(df.head())
......
~/.local/lib/python3.5/site-packages/quandl/connection.py in get_retries(cls)
72 status_forcelist=ApiConfig.retry_status_codes,
73 backoff_factor=ApiConfig.retry_backoff_factor,
---> 74 raise_on_status=False)
75
76 return retries
TypeError: __init__() got an unexpected keyword argument 'raise_on_status'
回答1:
The error appeared during instantiating of Retry and said Retry
is a class from urllib3.
There is raise_on_status
in urllib3
in the repository. Perhaps you have an older version of urllib3
and need to upgrade it.
回答2:
cd ~/.local/lib/python3.5/site-packages/quandl/
and Open connection.py
.
Go to line 74 and remove the argument raise_on_status
Worked for me!!
来源:https://stackoverflow.com/questions/53374097/unexpected-keyword-argument-raise-on-status