microsoft / MLOpsPython

MLOps using Azure ML Services and Azure DevOps
MIT License
1.2k stars 1.09k forks source link

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

Open arvind-dhariwal-zz opened 3 years ago

arvind-dhariwal-zz commented 3 years ago

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

magaudef commented 3 years ago

same error here..

lokijota commented 3 years ago

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):

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')