logging icon indicating copy to clipboard operation
logging copied to clipboard

package import problem

Open Shawn-IEITSystems opened this issue 4 years ago • 1 comments

The current import code: from ..compliance_checker import mlp_compliance

If we don't install the package and execute the python scripts directly, there will be an import error.

I think we shoud import like this:

sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../compliance_checker"))
import mlp_compliance

Shawn-IEITSystems avatar Jun 25 '20 03:06 Shawn-IEITSystems

It should not be a problem, even if the package is not installed.

Just follow the instructions from the readme, for example, package checker: https://github.com/mlperf/logging/tree/master/mlperf_logging/package_checker#usage

If you run python3 -m mlperf_logging.package_checker from the root of the logging repo, Python will find mlp_compliance without modifying the sys.path.

mwawrzos avatar Jun 26 '20 09:06 mwawrzos