2

I get an error while importing mlflow. Googled almost whole day - didn't find anything relevant that's able to solve problem

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\python\lib\site-packages\mlflow\__init__.py", line 41, in <module>
 from mlflow import projects  # pylint: disable=unused-import
File "E:\python\lib\site-packages\mlflow\projects\__init__.py", line 10, in <module>
import mlflow.projects.databricks
File "E:\python\lib\site-packages\mlflow\projects\databricks.py", line 12, in <module>
 from mlflow import tracking
File "E:\python\lib\site-packages\mlflow\tracking\__init__.py", line 8, in <module>
 from mlflow.tracking.client import MlflowClient
File "E:\python\lib\site-packages\mlflow\tracking\client.py", line 16, in <module>
 from mlflow.entities import Experiment, Run, RunInfo, Param, Metric, RunTag, FileInfo, 
ViewType
File "E:\python\lib\site-packages\mlflow\entities\__init__.py", line 6, in <module>
 from mlflow.entities.experiment import Experiment
 File "E:\python\lib\site-packages\mlflow\entities\experiment.py", line 2, in <module>
  from mlflow.entities.experiment_tag import ExperimentTag
File "E:\python\lib\site-packages\mlflow\entities\experiment_tag.py", line 2, in <module>
  from mlflow.protos.service_pb2 import ExperimentTag as ProtoExperimentTag
File "E:\python\lib\site-packages\mlflow\protos\service_pb2.py", line 18, in <module>
  from .scalapb import scalapb_pb2 as scalapb_dot_scalapb__pb2
File "E:\python\lib\site-packages\mlflow\protos\scalapb\scalapb_pb2.py", line 22, in <module>
 options = DESCRIPTOR.extensions_by_name['options']
  AttributeError: 'NoneType' object has no attribute 'extensions_by_name'
Usingless
  • 31
  • 4
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Kfir Ettinger Sep 28 '22 at 14:27
  • @KfirEttinger Sorry, what else could I add? I am importing "mlflow" and getting an error. That's it – Usingless Sep 28 '22 at 21:45
  • no sorry needed. you should specify how did you install `mlflow` and how did you import it to your project and every other detail about your project/python that could help. – Kfir Ettinger Sep 29 '22 at 14:18

1 Answers1

0

From mlflow documentation:

MLflow requires conda to be on the PATH for the projects feature.

Try following the following instructions from there:

# Install MLflow
pip install mlflow

# Install MLflow with the experimental MLflow Pipelines component
pip install mlflow[pipelines]  # for pip
conda install -c conda-forge mlflow-pipelines  # for conda

# Install MLflow with extra ML libraries and 3rd-party tools
pip install mlflow[extras]

# Install a lightweight version of MLflow
pip install mlflow-skinny
Kfir Ettinger
  • 584
  • 4
  • 13
  • Thank you for response. Mlflow imports in anaconda's prompt but it does not in cmd and PyCharm. And what "to be on the PATH for the projects feature" means? I added Anaconda3, Script and condabin to PATH. DOesn't work anyway – Usingless Sep 30 '22 at 08:56
  • It gives the same error when I run with -no-conda – Usingless Sep 30 '22 at 09:42
  • https://stackoverflow.com/questions/59331417/mlflow-projects-cant-find-conda-executable – Kfir Ettinger Oct 02 '22 at 09:26
  • https://github.com/mlflow/mlflow/issues/6072 'Installing protobuf==3.20.1 solved the issue.' – Ali Raza Jan 19 '23 at 10:30