Registry / data / pandas-datareader

pandas-datareader

JSON →
library0.11.1pypypi✓ verified 22d ago

Data readers extracted from the pandas codebase, pandas-datareader provides up-to-date remote data access for various financial and economic data sources, compatible with recent pandas versions. The library's release cadence is irregular, largely influenced by the frequent changes in external data provider APIs which often require rapid updates to its readers.

pip install pandas-datareader
INSTALL
IMPORT
SIG · PANDAS-DATAREADER
P
pandas-datareader
datapythonv0.11.1
Install
8.9s avg
Import
1634ms
Disk
184MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.676s · 181.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.9s · import 1.592s · 174MB
184MB installed
● package 184MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DataReader
from pandas_datareader.data import DataReader
from pandas.io.data import DataReader
DataReader was moved out of pandas into its own library in pandas v0.19.0.
pandas_datareader as pdr
import pandas_datareader as pdr
Common alias for the top-level module functions like get_data_fred.
pandas_datareader.data as web
import pandas_datareader.data as web
Common alias for the data submodule containing DataReader and various source-specific readers.

This example fetches the 10-Year Treasury Constant Maturity Rate (GS10) from FRED (Federal Reserve Economic Data) for a specified date range and prints the first few rows. FRED is generally reliable and does not require an API key for basic usage.

import pandas_datareader.data as web import datetime start = datetime.datetime(2020, 1, 1) end = datetime.datetime(2023, 1, 1) # Fetch data from FRED (Federal Reserve Economic Data) gs10 = web.DataReader('GS10', 'fred', start, end) print(gs10.head())
Debug
Known issues
breakingDropped support for Python 2.7 in v0.9.0. The minimum required Python version is now 3.6.
fix
Upgrade your Python environment to 3.6 or newer. Python 3.8+ is recommended.
affects: 0.9.0 and later
breakingIEX Cloud API Key Requirement: From v0.8.0, all IEX readers require an API token (`IEX_API_KEY`).
fix
Register for an API key on IEX Cloud and set it as an environment variable (e.g., `os.environ["IEX_API_KEY"] = "pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"`) or pass it directly to the reader.
affects: 0.8.0 and later
breakingRemoval or immediate deprecation of several data sources: Google Finance, Morningstar, and Robinhood were removed (deprecated in v0.7.0, removed in v0.8.0, Robinhood removed in v0.9.0). The AlphaVantage quote reader and Enigma were immediately deprecated in v0.9.0 due to API changes or service termination.
fix
Switch to alternative data sources or use a different library if these specific sources are critical to your workflow.
affects: 0.8.0 and later
gotchaYahoo Finance reader instability: The Yahoo Finance API is prone to frequent, unannounced changes, often leading to `RemoteDataError` or incorrect data. While v0.10.0 included fixes for Yahoo readers, it remains a common point of failure for users.
fix
Ensure you are on the latest `pandas-datareader` version. If issues persist, consider using the `yfinance` library directly or another robust financial data provider.
affects: All versions, especially prior to 0.10.0, and intermittently thereafter.
gotchaGeneral API instability and lack of frequent updates: Many data sources continuously change their APIs, causing readers in `pandas-datareader` to break. There is an acknowledged challenge in maintaining all readers, leading to periods where certain data sources may not function correctly between releases.
fix
Check the project's GitHub issues for known broken readers. For critical data, consider direct API integration or using dedicated client libraries for specific data providers.
affects: All versions, ongoing concern.
gotchaPotential incompatibility with Pandas 3.0: There are indications of anticipated breaking changes related to `pandas` 3.0. Users upgrading `pandas` to version 3.0 or higher may encounter issues.
fix
Monitor `pandas-datareader` GitHub issues and releases for updates on `pandas` 3.0 compatibility. Consider pinning your `pandas` version to a compatible older release if you encounter problems.
affects: Potentially 0.10.0 with pandas 3.0+
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pandas_datareader'
The `pandas-datareader` package is either not installed in the current Python environment or there's a typo in the import statement.
fix
Ensure the package is installed using `pip install pandas-datareader` and imported correctly as `import pandas_datareader as pdr` or `from pandas_datareader import data`.
RemoteDataError: Unable to read URL
This error typically occurs when the API of the data source (e.g., Yahoo Finance) has changed, or there are network issues preventing access to the URL.
fix
Update `pandas-datareader` to the latest version (`pip install --upgrade pandas-datareader`). If the issue persists, especially with Yahoo Finance, consider using an alternative library like `yfinance` to override `pandas-datareader`'s Yahoo Finance functionality by adding `import yfinance as yf; yf.pdr_override()` before calling `DataReader`.
AttributeError: module 'pandas' has no attribute 'DataReader'
The `DataReader` function is part of the `pandas_datareader` library, not `pandas` itself. This error occurs when attempting to call `pd.DataReader()` after only importing `pandas`.
fix
Import `DataReader` from `pandas_datareader` correctly, typically as `from pandas_datareader import data` and then use `data.DataReader()` or `import pandas_datareader as pdr` and use `pdr.DataReader()`.
KeyError: 'Adj Close'
This error indicates that the 'Adj Close' column, or another specified column, is not present in the DataFrame returned by `pandas-datareader`. This can happen if the data source no longer provides that specific column or if the data retrieval failed partially.
fix
Inspect the DataFrame returned by `DataReader` (e.g., by printing `df.head()` and `df.columns`) to verify available column names. Adjust your code to use the correct column name if it has changed, or handle cases where the column might be missing, possibly by switching to a different data source if 'Adj Close' is no longer provided.
RemoteDataError: Unable to read URL:
This general error often occurs when the data provider's API has changed, the URL is temporarily unavailable, or there's an issue with network connectivity.
fix
Upgrade pandas-datareader to the latest version using `pip install --upgrade pandas-datareader` to ensure compatibility with recent API changes, and verify your ticker symbol and date ranges.
Upgrade
Version history
0.11.1latest on PyPI · released Jun 24, 2026
Audit
Dependencies
pandasrequiredCore data structure for returned data.
lxmlrequiredRequired for parsing some web data sources.
requestsrequiredUnderlying HTTP library for fetching data.
yfinanceoptionalAlternative or supplemental reader for Yahoo Finance data, often used when the built-in Yahoo reader is broken due to API changes.
Agent activity
8 hits · last 30 days
node
6
Resources