import_file

(function from pyomo.common.fileutils)

pyomo.common.fileutils.import_file(path, clear_cache=False, infer_package=True, module_name=None)[source]

Import a module given the full path/filename of the file. Replaces import_file from pyutilib (Pyomo 6.0.0).

This function returns the module object that is created.

Parameters:
  • path (str) – Full path to .py file.

  • clear_cache (bool) – Remove module if already loaded. The default is False.