I've checked other answers on SO as well, but they don't seem to be like mine.
So I'm playing around with imports, and I decided to put my module custom.py into a nested folder like this:
/Users/alex/Desktop/Learn/mods/onemore/custom.py
My main script file is in the following location:
/Users/alex/Desktop/Learn/main.py
So when I do import custom in main.py, I get the error ModuleNotFoundError: No module named 'custom'
This happens despite the fact that /Users/alex/Desktop/Learn/mods/onemore is in PYTHONPATH:
> echo $PYTHONPATH
> /Users/alex/Desktop/Learn/mods/onemore
and also the path is visible in sys.path (the second one):
> ['', '/Users/alex/Desktop/Learn/mods/onemore', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages']
Why can't I still import the module?