Lets say this is my project structure :
codes - pre.py training - model.py
Both folder have empty __init__.py inside them, an
__init__.py
try using full path of your code folder
import sys sys.path.insert(0, "fullpath") from pre import *