Q:

Import from sibling directory - Python 3.7

I've read some articles about modules and packages in Python (including their own tutorial), but couldn't get it to work properly on my project. I'm using Python 3.7.5
This is my directory structure:
framework/
    __init__.py
    build/
    classifiers/
    extraction/
        extractionFile.py
    quality/
    utils/
        utilsFile.py

On extractionFile.py I have this line:
from ..utils.utilsFile import functionName

But when I run the extractionFile.py from the extraction directory I get the following error:
Traceback (most recent call last):
  File "extractionFile.py", line 25, in <module>
    from ..utils.utilsFile import functionName
ImportError: attempted relative import with no known parent package

If I run extractionFile.py from the framework directory using:
from utils.utilsFile import functionName

It works properly.
So how can I turn only the utils directory into a package in order to import any file that is inside of it from siblings directories?
Note: I only need to use the package on this project.
Note: I'm trying to get a permanent solution, so sys.path.insert() doesn't seem to be an option.

Edit: The answer marked as correct works, but I ended up with a different solution. From the framework directory simple run (I'm using Linux):
DIR=$(pwd) && export PYTHONPATH="${PYTHONPATH}:$DIR"

This puts the framework directory on sys.path variables for Python. Making it a path for Python to look for packages and modules.
I guess you just use the one that suits better for your case.

A:

Relative imports only work within the root of each library path and you cannot use relative import to reach the parent of the root of a library path. In the case of importing modules from your own project the root path of the library is where the interpreter is run, so in order to import utils/utilsFile.py you have to run extractionFile.py from framework instead of extraction.
If you do want to be able to run extractionFile.py from extraction, however, an easy solution would be to add .. to the library path by appending it to the sys.path list, so that the parent directory of extraction would be one of the library paths, and so that you can import from utils.utilsFile directly:
import sys
sys.path.append('..')
from utils.utilsFile import functionName

