Why wont python let me import internal packages

I'm trying to create a machine (what it does is irrelevant just giving a little context)I've been making some packages for me to use inside the software that will control it but it won't let me import my files from other packages, I have no idea why it's doing this and tried everything it's very frustrating I've tried

import test
import src.test
from src import test
from ..src import test
from .src import test 

I'm trying to access test.py in src package from test.py in the debug package. Below is a screenshot of my vsCode directory list and when I try to import it BTW I also ran the code to make sure it wasn't just the text editor being all wack

Stack overflow won't let me display image till 10 reputation


Solution 1:

import sys
sys.path.append('relaive/path/to/debug/folder')
import name_of_file

if not an inbuilt package, Python only searches in the current directory when you try to import, thus we have to add this path, so that it looks inside this particular folder as well. After adding that, you can simply do the import.