Modulenotfounderror: no module named ‘pandas_datareader’ [SOLVED]

In this article, we will explore how to solve Modulenotfounderror: no module named ‘pandas_datareader error. We will provide various solutions to resolve it.

What is no module named ‘pandas_datareader’?

The Modulenotfounderror: no module named ‘pandas_datareader‘ error when the pandas_datareader is not installed and it is imported in your code.

Additionally, your python version is different from the pandas package installed in your system.

How to fix Modulenotfounderror: no module named ‘pandas_datareader’

Here are the following options you can use to fix this error.

  1. Install the pandas_datareader module.

    Particularly there are various options in installing pandas_datareader, select what works best for you.

    Solution 1. Install module using pip.

    pip install pandas-datareader

    Install pandas datareader

    Solution 2. Upgrade pip
    After installation, if still not fixing the issue try to upgrade, use this command—
    pip install pip –upgrade

    upgrade pandas datareader

    Solution 3. Install using conda
    Like pip conda is also a package manager, you may use this command—
    conda install pandas-datareader

    Solution 4. Install from the source

    git clone https://github.com/pydata/pandas-datareader.git
    cd pandas-datareader
    python setup.py install


    If you are using Linux use the following command:

    sudo python3 -m pip install pandas_datareader

  2. Fix the path.

    When you follow all the options above no doubt you’d fix the error.

    However if not, this time we’ll fix it through by correcting the path.

    Here are the things you should do.

    1. If you install the module through pip, you need to uninstall it before installing it again.

    The purpose of this is to eliminate incompatible versions and fixed the path.

    Use this command to uninstall the package.
    pip uninstall pandas_datareader

    2. To fix the pandas package incompatibility, use the command below:
    pip3 install –upgrade pandas

    3. Finally, restart the python kernel and retire it to completely fix the error.

Fixing no module named ‘pandas_datareader’ in macOs

If you are encountering the same issue or error on Mac even if you had install it already.

The following steps will help you fix this error:

Step 1: Uninstall the pandas_datareader package.

  • In your terminal input pip uninstall pandas_datareader and press Enter. This will prompt asking y/n and if you type y this will uninstall the package.

Step 2: Restart the IDE you are using.

  • If you are using you need to restart it.

Step 3: Re-install pandas_datareader package

  • In your terminal, type this command pip install pandas_datareader.

Note: If your terminal shows a lot “pre-installed” pandas_datareader package with message “Requirement already satisfied…” just ignore it.

Step 4: Run the python code again

  • The error No module named ‘pandas_datareader error should be fixed.

Conclusion

In conclusion, by following the steps outlined in this article, you should be able to resolve the error and resume the normal operation of your Python scripts and applications.

We hope that this article has provided you with the information you need to fix this error and continue working with Python packages.

If you are finding solutions to some errors you’re encountering we also have Modulenotfounderror no module named tensorflow contrib.

Leave a Comment