Open bjpenck opened 10 hours ago
Hey @bjpenck! I'm here to help you with any bugs, questions, or contributions. Let's squash those bugs together!
The FileNotFoundError
you're encountering suggests that the code is trying to access a file named dataframe.csv
in the pandasai
package, but it doesn't exist. However, based on the available information, there is no specific mention of a dataframe.csv
file being used or generated by the pandasai
package. Instead, the package typically uses Parquet files for saving dataframes [1].
Here are a few steps you can take to troubleshoot and resolve this issue:
Check File Path: Ensure that the file path being referenced is correct and that the file actually exists at that location. If the file is supposed to be generated by your code, verify that the code responsible for creating it is executing correctly.
Review Code Logic: Look into the part of your code where the file path is being set or used. Make sure that the logic aligns with how files are managed in the pandasai
package.
Update or Modify Code: If your code or a library you're using expects a CSV file, you might need to adjust it to work with the Parquet format instead, or ensure that the CSV file is created and available at the expected location.
Check for Custom Modifications: If there have been any custom modifications to the pandasai
package or your project setup, ensure they are correctly implemented and do not interfere with file paths.
If these steps do not resolve the issue, consider checking the documentation or source code for any additional context on file handling within the pandasai
package.
To continue talking to Dosu, mention @dosu.
I did not generate a file in the logic code, but uploaded a data file for data analysis.
2024-10-30 11:44:03 [INFO] Code generated:
for i in range(len(dfs)):
df = dfs[i]
conditions = [(df['order'] >= 500) & (df['order'] <= 1000), (df['number'] >= 1) & (df['number'] <= 50)]
result = df.query(conditions).to_dict()
for row in result:
for col in ['order', 'number']:
if isinstance(row[col], str):
try:
int(row[col])
row[col] = int(row[col])
except ValueError:
pass
2024-10-30 11:44:03 [INFO] Executing Step 2: CodeCleaning 2024-10-30 11:44:03 [INFO] Code running:
for i in range(len(dfs)):
df = dfs[i]
conditions = [(df['order'] >= 500) & (df['order'] <= 1000), (df['number'] >= 1) & (df['number'] <= 50)]
result = df.query(conditions).to_dict()
for row in result:
for col in ['order', 'number']:
if isinstance(row[col], str):
try:
int(row[col])
row[col] = int(row[col])
except ValueError:
pass
2024-10-30 11:44:03 [ERROR] Failed with error: Traceback (most recent call last):
File "/Users/cindy/Documents/AI/jiaoxing/jiaoxing/.venv/lib/python3.11/site-packages/pandasai/pipelines/chat/code_execution.py", line 85, in execute
result = self.execute_code(code_to_run, code_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cindy/Documents/AI/jiaoxing/jiaoxing/.venv/lib/python3.11/site-packages/pandasai/pipelines/chat/code_execution.py", line 171, in execute_code
exec(code, environment)
File "
2024-10-30 11:44:03 [ERROR] Pipeline failed on step 6: 'NoneType' object is not subscriptable
![Uploading 1730260427608.jpg…]()
System Info
python3.11/ macos 13.2.1/ pandasai later
After uploading the excel data and querying for a while, this problem always occurs in the end: FileNotFoundError: [Errno 2] No such file or directory: '/Users/cindy/Documents/AI/jiaoxing/jiaoxing/.venv/lib/python3.11/site-packages/pandasai/pipelines/chat/dataframe.csv'
🐛 Describe the bug
llm = LocalLLM(api_base="http://localhost:11434/v1", model="codellama:7b") smart = SmartDataframe(df, config={"llm": llm}) prompt =st.text_area("search..") if(st.button("search")): if prompt: with st.spinner("think.."): st.write(smart.chat(prompt))