xxxxxxxxxx
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# import ../db.py
import db
xxxxxxxxxx
from pathlib import Path
path = Path("/here/your/path/file.txt")
print(path.parent.absolute())
xxxxxxxxxx
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import mymodule
OR
import os, sys
sys.path.insert(1, os.getcwd())
import variables
xxxxxxxxxx
from pathlib import Path
file_path = '/home/user/Downloads/ips'
path = Path(file_path)
print(path.parent.absolute())
xxxxxxxxxx
from setuptools import setup, find_packages
setup(name='myproject', version='1.0', packages=find_packages())