Reputation: 119
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
Upvotes: 0
Views: 15498
Reputation: 1
it is due to !pip install
as this install the library at base environment in jupyter notebook.
But pip install
installs the library in local/current environment.
Upvotes: 0
Reputation: 1
I encountered the same issue and solved it. I first checked if pandasql was installed or not. I searched for pandasql in the file explorer and founded it somewhere, I copied the pandasql file and placed it in anaconda3\Lib\site-packages. Then, the issue was solved
Upvotes: 0
Reputation: 71
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
Upvotes: 3
Reputation: 63
I think either your python you are using is wrong/doesn't have the code, or you haven't installed or printed it right.
Upvotes: 1