'ModuleNotFoundError: No Module name 'pandasql'

I am trying to import pandasql. I am running the following code in a jupyter notebook running python:

!pip install pandasql
from pandasql import sqldf
import pandas as pd

This logs an error saying ModuleNotFoundError: No Module name 'pandasql'

I understand this is a common problem and have tried using the following SO posts to fix the solution without results:

ImportError: No module named pandas

How to fix ModuleNotFoundError: No module named 'pandas_datareader'

pandasql will not import : ImportError: cannot import name to_sql



Solution 1:[1]

I know I am quite late in responding this but try this, but as you are working on Jupyter notebook, you can try pip install pandasql in Anaconda prompt

Solution 2:[2]

I think either your python you are using is wrong/doesn't have the code, or you haven't installed or printed it right.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kimcodes
Solution 2 1010011010