I am trying to call a function defined in file lidar_source_code.py
from my main script py_lidar_depressions.py
. There are numerous sources which explain how to do this such as this one, however When I attempt this the error ModuleNotFoundError: No module named 'lidar_source_code'
is returned. I must say that I am not surprised at this error as at no point did I point to where the file is located even though relevant tutorials do not seem to suggest the need to. The code to import the file and all of the defined functions was as simple as the following.
from lidar_source_code import *
Is there something I am missing here. Am I correct that one must first define the path of the function containing file before importing it?
Thanks