I had a def hello() function in my home/file.py. I created a home/common/utils.pyfile and moved the function there.
Then I imported it like this: from utils import hello and the import in my file doesn't throw an error.
The path was also added to my settings.json automatically:
"python.analysis.extraPaths": [
"home/common"
]
However, when I run the code, it says Runtime.ImportModuleError: Unable to import module 'file': No module named 'utils'
So what's the correct way to create a utils module?
in file.py:
from common.utils import hello