mlflow / mlflow

Open source platform for the machine learning lifecycle
https://mlflow.org
Apache License 2.0
18.44k stars 4.17k forks source link

[BUG] libraries installation fails when using python_env in Windows #9647

Closed Abhishek-TyRnT closed 12 months ago

Abhishek-TyRnT commented 1 year ago

Issues Policy acknowledgement

Willingness to contribute

Yes. I can contribute a fix for this bug independently.

MLflow version

System information

Describe the problem

While running the https://github.com/mlflow/mlflow/tree/master/examples/hyperparam example in windows. Windows is not able to find pyenv

The reason for this is subprocess called in https://github.com/mlflow/mlflow/blob/3cfddde01a5b3813bd760fc96a8abf833c78a9ef/mlflow/utils/virtualenv.py#L102

needs shell=True argument if the OS is not linux.

Tracking information

Follow the README at https://github.com/mlflow/mlflow/tree/master/examples/hyperparam to reproduce the issue

Code to reproduce issue

Traceback (most recent call last):
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\Scripts\mlflow.exe\__main__.py", line 7, in <module>
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "D:\mlflow\mlflow\mlflow\cli.py", line 204, in run
    projects.run(
  File "D:\mlflow\mlflow\mlflow\projects\__init__.py", line 337, in run
    submitted_run_obj = _run(
  File "D:\mlflow\mlflow\mlflow\projects\__init__.py", line 106, in _run
    submitted_run = backend.run(
  File "D:\mlflow\mlflow\mlflow\projects\backend\local.py", line 160, in run
    python_bin_path = _install_python(python_env.python, pyenv_root=pyenv_root)
  File "D:\mlflow\mlflow\mlflow\utils\virtualenv.py", line 125, in _install_python
    else _find_latest_installable_python_version(version)
  File "D:\mlflow\mlflow\mlflow\utils\virtualenv.py", line 101, in _find_latest_installable_python_version
    lines = _exec_cmd(
  File "D:\mlflow\mlflow\mlflow\utils\process.py", line 95, in _exec_cmd
    process = subprocess.Popen(
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\kulka\anaconda3\envs\mlflow_dev\lib\subprocess.py", line 1327, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Stack trace

REPLACE_ME

Other info / logs

REPLACE_ME

What component(s) does this bug affect?

What interface(s) does this bug affect?

What language(s) does this bug affect?

What integration(s) does this bug affect?

BenWilson2 commented 1 year ago

Hi @Abhishek-TyRnT thanks for the PR and fix! Just a quick fix on the PR's commit history and we'll be good to go!

github-actions[bot] commented 1 year ago

@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.