kingjulio8238 / memary

Human Memory for AI Agents.
https://www.memarylabs.com
MIT License
1.14k stars 79 forks source link

ModuleNotFoundError: No module named 'src' #21

Closed scrambled2 closed 1 month ago

scrambled2 commented 1 month ago

I'm in the right directory, everything is present. I'm using a local virtual environment in Windows 11.

The .env file is there.

No matter what when I run it, I get this.

ModuleNotFoundError: No module named 'src' Traceback: File "E:_toptools\memary\venv\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "E:_toptools\memary\streamlit_app\app.py", line 19, in from src.agent.chat_agent import ChatAgent

If I move the src directory under the streamlit_app directory then it at least loads the streamlit front end for the question but then it fails.

What am I missing?

shreybirmiwal commented 1 month ago

@scrambled2 I had the same issue even though I followed the doc to run it, here's how I workaround it It has to do with the parent directory set by os package so that the code can access the diff folders

on /streamlit_app/app.py
replace:
parent_dir = os.path.dirname(curr_dir)
with:
parent_dir = os.path.dirname(curr_dir) + '/memary' 

Then, move the data folder from /streamlit_app to outside, at the same level as src

kingjulio8238 commented 1 month ago

Thanks @shreybirmiwal ! We have these instructions in the readme post PR #26 merge so closing this discussion.