I have the following problem.
I have a directory structure like this for the following repo (https://github.com/OthersideAI/self-operating-computer):
soc
- exceptions.py
- main.py
- operate.py
- init.py
- listener.sh (This is created by me which has a function to execute a prompt using SOC. Please find below the block of code)
When I run the listener.sh, it executes the following block from the script
execute_prompt() {
prompt=”$1″
echo “Executing prompt: $prompt”
python “$OPERATE_PY” –prompt “$prompt” “$@”
}
The issue, I am facing now is, it always complains of – ModuleNotFoundError: No module named ‘operate.exceptions’; ‘operate’ is not a package
This is from operate.py
import sys
import os
import time
import asyncio
from prompt_toolkit.shortcuts import message_dialog
from prompt_toolkit import prompt
from operate.exceptions import ModelNotRecognizedException
import platform
Now, I see the following:
- init.py is present
- The current and parent directory is set. Have checked it by printing sys.path
- Tried with Python 3.12 and 3.10
- Virtualenv is activated
- Checked for typo
What am i missing?
Also, the project runs fine, if I directly run ‘operate’ command, but encounter the ModuleNotFoundError: No module named ‘operate.exceptions’; ‘operate’ is not a package
while running through the listener.sh
Ajitava Deb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.