hey everyone,
I am working on a large project, so I need to structure it for better code understand and readability, but I am facing an unusual problem which python is troughing an ModuleNotFound error when I am trying to import my files from another directory, can anyone please solve this error?
Project Structure:
|-Project
|--.GUI
|--main.py
|--.TUI
|--main.py
|--agents
|--main.py
|--assets
|--logo.ico
|--logo.jpeg
|--quadana.yaml
|--core
|--core_utils
|--audio_processing.py
|--AutomateFunctions.py
|--dicts.py
|--news.py
|--os_functions.py
|--process_query.py
|--scheduler.py
|--SendWhatMessage.py
|--TextBasedLuna.py
|--weather.py
|--main.py
|--Installer
|--models
|--locals
|--Luna.py
|--Ollama
|--large_models
|--medium_models
|--llama
|--codellama
|--codellama.py
|--codellama34b.py
|--codellama70b.py
|--llama2
|--llama2.py
|--llama2_70b.py
|--mistral
|--mistral.py
|--small_models
|--gemmma_models
|--gemma.py
|--gemma2b.py
|--gemma7b.py
|--llama_models
|--codellama
|--codellama7b.py
|--codellama13b.py
|--llama2
|--llama2_7b.py
|--llama2_13b.py
|--utils
|--audio_processing.py
|--AutomateFunctions.py
|--dicts.py
|--news.py
|--os_functions.py
|--process_query.py
|--Weather.py
But when I am trying to load files from utils in .TUI/main.py file then this error is displaying;
Traceback (most recent call last):
File "C:\Users\Hamdan\PycharmProjects\Luna\.TUI\main.py", line 2, in <module>
from utils.process_query import query_processer
ModuleNotFoundError: No module named 'utils'
and same problem is occurring for .GUI/main.py
I am importing files from utils like this:
from utils.process_query import query_processer
from utils.audio_processing import recognize_audio
from utils.Weather import get_weather
from utils.news import get_news
from utils.dicts import *
from utils.os_functions import *
from utils.AutomateFuctions import DesktopAssistant
Even my Pycharm is not showing me any warning and error while coding, but this unusual error is now become the bone of my throat, is there any solution of this problem guys? If you know please tell me!!
Top comments (0)