In the error stack trace you attached (Error.pdf
), the “real” error is:
File ~\anaconda3\lib\site-packages\dbnomics\__init__.py:572, in _fetch_response(url, timeout)
570
timeout = default_timeout
--> 572 response = httpx.get(url, follow_redirects=True, timeout=timeout)
574 if response.status_code in {429, 500, 502, 503, 504}:
TypeError: get() got an unexpected keyword argument 'follow_redirects'
This makes me think that a wrong version of the httpx
dependency could be installed.
However I could not reproduce the problem.
Doing it myself, here is my command-line logs from scratch:
$ python -V
Python 3.11.6
$ virtualenv dbnomics-venv
$ . ./dbnomics-venv/bin/activate
$ pip install dbnomics
[...]
# Checking the versions of the dependencies
$ pip list
Package Version
--------------- ------------
anyio 4.2.0
certifi 2023.11.17
dbnomics 1.2.5
h11 0.14.0
httpcore 1.0.2
httpx 0.26.0
idna 3.6
numpy 1.26.3
pandas 2.1.4
pip 23.3.2
python-dateutil 2.8.2
pytz 2023.3.post1
setuptools 69.0.3
six 1.16.0
sniffio 1.3.0
tenacity 8.2.3
tzdata 2023.4
wheel 0.42.0
$ python
Python 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbnomics
>>> dbnomics.fetch_series('OECD', 'MEI', 'USA.B6BLTT01.CXCUSA.Q')
@frequency provider_code dataset_code ... Subject Measure Frequency
0 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
1 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
2 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
3 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
4 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
.. ... ... ... ... ... ... ...
250 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
251 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
252 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
253 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
254 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
[255 rows x 18 columns]
>>>
How did you install the dbnomics
module locally? What’s your Python version (because older Python versions could lead to an older version of httpx
also)?
PS: just for your information, instead of a screenshot or a PDF, which are not very convenient to read and copy-paste, the idiomatic way to attach source code in forum messages is by using “fenced code blocks”, cf docs