Installing pandasai

hello Community, i am getting an error below while trying to install pandasai. any help?
ImportError: cannot import name ‘PandasAI’ from ‘pandasai’ (C:\Users\RONALD AINEBYONA\AppData\Local\Programs\Python\Python311\Lib\site-packages\pandasai_init_.py)

Hi - This is not an error while you are trying to install pandasai. It’s an error while you are trying to import pandasai in a Python script.

I assume that your error was triggered by the following code:

from pandasai import PandasAI

Since there is no class (or other kind of thing) called “PandasAI” in pandasai that line will trigger an ImportError.

Btw - Looking in the pandasai codebase, I just noticed that PandasAI did exist up to a few weeks ago, but it was removed. So, if you’re trying to run some older code, you’d need to re-install an earlier version of pandasai (see: refactor: remove PandasAI · gventuri/pandas-ai@8345b22 · GitHub).

3 Likes

thanks so much

Hi, R you now able to import PanasAI, I m using pandasai==1.4.1

I’m also getting the same error, anyone please help

Error is:

ImportError Traceback (most recent call last)
/tmp/ipykernel_14340/1095739920.py in
----> 1 from pandasai import PandasAI
2 from pandasai.llm.openai import OpenAI

ImportError: cannot import name ‘PandasAI’ from ‘pandasai’ (/home/sash/.local/lib/python3.10/site-packages/pandasai/init.py)

Did you try reading @hansgeunsmeyer 's post above?