MLOpsPython icon indicating copy to clipboard operation
MLOpsPython copied to clipboard

When i use this image mcr.microsoft.com/mlops/python:latest I always get "ModuleNotFoundError: No module named 'lightgbm'"

Open arvind-dhariwal-zz opened this issue 4 years ago • 2 comments
trafficstars

When i use this image mcr.microsoft.com/mlops/python:latest I always get "ModuleNotFoundError: No module named 'lightgbm'"

arvind-dhariwal-zz avatar Feb 09 '21 17:02 arvind-dhariwal-zz

same error here..

magaudef avatar Apr 27 '21 15:04 magaudef

This error is probably due to conda/environments not being correct. If that is the case, I'd suggest going to the generated `ml_service/pipelines/xxx_build_train_pipeline.py file and make one of these changes:

in the

# Create a reusable Azure ML environment
    environment = get_environment(
        aml_workspace,
        e.aml_env_name,
        conda_dependencies_file=e.aml_env_train_conda_dep_file,
        create_new=e.rebuild_env,
    )

.. call, set create_new to true. Alternatively (and this I've tested):

  • comment the above code and the line run_config.environment = environment
  • Add below run_config = RunConfiguration():
run_config.environment = Environment.from_conda_specification(name="scoringenv", file_path="xxx/conda_dependencies.yml")

You'll also need to import Environment in this code, at the top, and either write the conda_dependencies.yml file manually (including lightgbm) or write it out with a call to:

your_environment_variable.save_to_directory('somefoldername')

lokijota avatar Apr 27 '21 15:04 lokijota