The problem here is that you can't do relative imports from the file you execute since __main__ module is not a part of a package.
Absolute imports - import something available on sys.path.
Relative imports - import something relative to the current module, must be a part of a package.
For you to understand it clearly here's an example:
.
./main.py
./ryan/__init__.py
./ryan/config.py
./ryan/test.py
Then update test.py:
# config.py
debug = True
# test.py
print(__name__)
After that try:
# Trying to find module in the parent package
from . import config
print(config.debug)
del config
except ImportError:
print('Relative import failed')
Then try this:
# Trying to find module on sys.path
import config
print(config.debug)
except ModuleNotFoundError:
print('Absolute import failed')
# main.py
import ryan.test
After doing this try running test.py first:
$ python ryan/test.py
__main__
Relative import failed
True
At this stage import config should work, since the ryan folder will be added to sys.path.
I hope this helps.