I'm trying to dynamically import some files on a Python server using Gunicorn.
Previously, imports of files, not modules (they do not have __init__.py), went fine with
from .path.to.file import ClassName
I'm now trying to do this dynamically. I've browsed all of the related questions, and tried using __import__('ClassName') and importlib.import_module('.path.to.file', 'ClassName') however they all return ModuleNotFoundError.
What's the correct way to do dynamic import of files that are not modules?