ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.97k stars 5.77k forks source link

[<Ray Core|RLlib>] ray.init() fails on windows #25290

Closed Bardbo closed 2 years ago

Bardbo commented 2 years ago

What happened + What you expected to happen

Python 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:40:06) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import ray ray.init() Traceback (most recent call last): File "", line 1, in File "C:\software\code\anaconda3\envs\pytorch_env\lib\site-packages\ray_private\client_mode_hook.py", line 105, in wrapper return func(*args, **kwargs) File "C:\software\code\anaconda3\envs\pytorch_env\lib\site-packages\ray\worker.py", line 900, in init soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE) AttributeError: module 'resource' has no attribute 'getrlimit' ray.version '2.0.0.dev0' from ray.rllib.agents.a3c.a3c import A3CTrainer

Versions / Dependencies

windows 10 education python 3.9.9 ray 2.0.0.dev0

Reproduction script

import ray ray.init()

Issue Severity

High: It blocks me from completing my task.

tupui commented 2 years ago

Hi @Bardbo, thank you for reporting. Do you maybe happen to have a module/file named resource in your application?

This error is usually caused by a name conflict between Python standard library resource and a local file or module named resource.

Bardbo commented 2 years ago

Thank you very much. As you said, I found that there is a resource in lgsvl

bushshrub commented 2 years ago

Are you able to resolve the issue?

Bardbo commented 2 years ago

Hi@xiurobert, I have solved the issue,pip uninstall lgsvl

tupui commented 2 years ago

Thank you @Bardbo for confirming. I closed the issue then since there is nothing we can really do on ray's side. The problem should be reported to the library defining module names which conflict with the standard library.