You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决ModuleNotFoundError: No module named 'pandas_datareader'错误?

Fixing ModuleNotFoundError: No module named 'pandas_datareader'

Hey there, that error happens because pandas_datareader isn’t part of Python’s standard library, nor does it come bundled with pandas by default—it’s a separate package you need to install first. Let’s get this sorted quickly so you can get back to your tutorial:

1. Install using pip (most common approach)

Open your terminal or command prompt and run one of these commands, depending on your setup:

  • If pip is linked to your Python 3 environment (or you’re using Python 2):
    pip install pandas-datareader
    
  • If you have multiple Python versions and need to target Python 3 explicitly:
    pip3 install pandas-datareader
    
  • Pro tip: If you’re using a virtual environment (highly recommended for project isolation), make sure it’s activated before running the command.

2. Install using conda (for Anaconda/Miniconda users)

If you manage your Python environment with Anaconda, run this command in your terminal:

conda install -c anaconda pandas-datareader

Verify the installation

Once the install finishes, test it to make sure it worked. Open a Python shell or your IDE and run:

import pandas_datareader

If you don’t get any error messages, you’re all set to jump back to the 7:14 mark in your tutorial!

Quick note on permission issues

If you hit a permission error (common on macOS/Linux), avoid using sudo (it can mess up your system-wide Python setup). Instead, either use a virtual environment, or add the --user flag to install the package only for your user account:

pip install --user pandas-datareader

内容的提问来源于stack exchange,提问作者Oscar Bomboscar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:13:11