mlflow: [BUG] No module named 'scipy' when serving example model

Thank you for submitting an issue. Please refer to our issue policy for additional information about bug reports. For help with debugging your code, please refer to Stack Overflow.

Please fill in this bug report template to ensure a timely and thorough response.

Willingness to contribute

The MLflow Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the MLflow code base?

  • Yes. I can contribute a fix for this bug independently.
  • Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
  • No. I cannot contribute a bug fix at this time.

System information

  • Have I written custom code (as opposed to using a stock example script provided in MLflow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Catalina 10.15.7
  • MLflow installed from (source or binary):
  • MLflow version (run mlflow --version): mlflow, version 1.13.1
  • Python version: Python 3.6.12 :: Anaconda, Inc.
  • npm version, if running the dev UI:
  • Exact command to reproduce: mlflow models serve -m <model> -p 1234

Describe the problem

When following the tutorial in the documentation, mlflow models serve command fails instead of serving the model.

Code to reproduce issue

  • Start with an empty conda env. Install python 3.6. conda create -n mlflow python=3.6.
  • conda activate mlflow
  • pip install mlflow scikit-learn
  • Follow the tutorial https://mlflow.org/docs/latest/tutorials-and-examples/tutorial.html
  • mlflow run command will successfully run the tutorial example
  • mlflow models serve command will fail with ModuleNotFoundError: No module named 'scipy'

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

What component(s), interfaces, languages, and integrations does this bug affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/projects: MLproject format, project running backends
  • area/scoring: Local serving, model deployment tools, spark UDFs
  • area/server-infra: MLflow server, JavaScript dev server
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, JavaScript, plotting
  • area/docker: Docker use across MLflow’s components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

# Create a clean env
>>> conda create -n fresh python=3.6
>>> conda activate fresh

# pip
>>> pip install 'scikit-learn==0.19.1'
Collecting scikit-learn==0.19.1
  Using cached scikit_learn-0.19.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (7.6 MB)
Installing collected packages: scikit-learn
Successfully installed scikit-learn-0.19.1

=> install only scikit-learn

# conda
>>> conda install -c conda-forge 'scikit-learn=0.19.1'
...
The following NEW packages will be INSTALLED:

  blas               conda-forge/osx-64::blas-1.1-openblas
  libgfortran        conda-forge/osx-64::libgfortran-3.0.1-0
  numpy              conda-forge/osx-64::numpy-1.15.2-py36_blas_openblashd3ea46f_1
  openblas           conda-forge/osx-64::openblas-0.2.20-8
  python_abi         conda-forge/osx-64::python_abi-3.6-1_cp36m
  scikit-learn       conda-forge/osx-64::scikit-learn-0.19.1-py36_blas_openblas_201
  scipy              conda-forge/osx-64::scipy-1.1.0-py36_blas_openblash7943236_201 🔥

=> install other dependencies