DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
import imp
Error during startup: Could not load list of options from OpenDroneMap. Is OpenDroneMap installed in /home/simple/ODM? Make sure that OpenDroneMap is installed and that --odm_path is set properly: Unexpected token / in JSON at position 16354
odm=imp.load_source('context', sys.argv[2] + '/opendm/context.py')
可以通过odm调用context中的方法。
spec2 = importlib.util.spec_from_file_location('context', sys.argv[2] + '/opendm/context.py')
odm = importlib.util.module_from_spec(spec2)
spec2.loader.exec_module(odm)
之后也可以通过odm调用context中的方法。