Sinaptik-AI / pandas-ai

Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
https://pandas-ai.com
Other
11.7k stars 1.08k forks source link

ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject #1251

Open NehaKoppikar opened 5 days ago

NehaKoppikar commented 5 days ago

System Info

OS Version: 14.4.1 Python Version: 3.9.7 PandasAI version: 0.2.2

🐛 Describe the bug

Used the following code:

import os import pandas as pd from pandasai.agent import Agent

Sample DataFrame

sales_by_country = pd.DataFrame({ "country": ["United States", "United Kingdom", "France", "Germany", "Italy", "Spain", "Canada", "Australia", "Japan", "China"], "sales": [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600, 4500, 7000] })

By default, unless you choose a different LLM, it will use BambooLLM.

You can get your free API key signing up at https://pandabi.ai (you can also configure it in your .env file)

os.environ["PANDASAI_API_KEY"] = ""

agent = Agent(sales_by_country) response = agent.chat('write insight about data') print(response)

dosubot[bot] commented 5 days ago

To resolve the ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject error, you can try updating or reinstalling the numpy package. This error often occurs due to a mismatch between the versions of numpy and other packages that depend on it.

Here is how you can update numpy using pip:

pip install --upgrade numpy

If updating numpy does not resolve the issue, you can try reinstalling it:

pip uninstall numpy
pip install numpy

Additionally, ensure that all your packages are compatible with each other by updating them:

pip install --upgrade pandas pandasai

These steps should help resolve the binary incompatibility issue [1].

To continue talking to Dosu, mention @dosu.

NehaKoppikar commented 5 days ago

This is not resolving the issue

wjjc1017 commented 3 days ago

This is because numpy has recently been upgraded to version 2.0.0, which is different from version 1.26.*. By default, pip install numpy==2.0.0 is used. The solution is simply to run pip install numpy==1.26.4 pyyaml