8000 Ray component: Core ray.init() fails on windows since #51731 · Issue #54151 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ray component: Core ray.init() fails on windows since #51731 #54151
Open
@bmaranville

Description

@bmaranville

What happened + What you expected to happen

On Windows, install ray>=2.45, and then do

import ray
ray.init()

What Happened

An error:

The last 20 lines of C:\Users\bbm\AppData\Local\Temp\ray\session_2025-06-26_14-25-18_826351_13400\logs\dashboard.log (it contains the error message from the dashboard):
Traceback (most recent call last):
  File "C:\Users\bbm\AppData\Local\mambaforge\envs\refl1d312\Lib\site-packages\ray\dashboard\dashboard.py", line 246, in <module>
    logging_utils.redirect_stdout_stderr_if_needed(
  File "C:\Users\bbm\AppData\Local\mambaforge\envs\refl1d312\Lib\site-packages\ray\_private\logging_utils.py", line 49, in redirect_stdout_stderr_if_needed
    sys.stderr = open_log(stderr_fileno, unbuffered=True, closefd=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bbm\AppData\Local\mambaforge\envs\refl1d312\Lib\site-packages\ray\_private\utils.py", line 444, in open_log
    stream = open(path, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 6] The handle is invalid

What I expected to happen

No error

I tried running ray.init(include_dashboard=False) but it did not help. It seems to be caused by a Windows-specific error when trying to redirect stdout or stderr, introduced in #51731

Versions / Dependencies

Python 3.12
Ray > 2.44
OS: Windows 11

Reproduction script

import ray
ray.init()

Issue Severity

High: It blocks me from completing my task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that is supposed to be working; but isn'tcoreIssues that should be addressed in Ray CorestabilitytriageNeeds triage (eg: priority, bug/not-bug, and owning component)windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0