Ray.init() hangs

When I call ray.init() (or tune.run(...), which then eventually itself calls ray.init()), everything hangs.

I’ve tracked down the hang to line 1257 of ray/worker.py, which looks like this:

    worker.core_worker = ray._raylet.CoreWorker(
        mode, node.plasma_store_socket_name, node.raylet_socket_name, job_id,
        gcs_options, node.get_logs_dir_path(), node.node_ip_address,
        node.node_manager_port, node.raylet_ip_address, (mode == LOCAL_MODE),
        driver_name, log_stdout_file_path, log_stderr_file_path,
        serialized_job_config, node.metrics_agent_port, runtime_env_hash)

I wasn’t able to track it down further because even trying to “step in” hangs.

Using ray 1.4.1 on Windows in a python 3.7.9 venv.

Hmm I believe it is a known issue that Ray hangs on Windows when it is used with venv. Maybe if you use conda, the issue will be fixed. Is it possible for you to verify that?

That did do it.
I installed conda (using chocolatey), made a conda environment, then installed ray-core (1.4.0) to that conda environment from conda-forge. When running in this conda environment, ray.init() did not hang, and successfully gave me the info such as node_ip_address

1 Like