_winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2]

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

Hi all,

I am getting the following error:

policy_server.py -ip=localhost -checkpoint=brawl
Traceback (most recent call last):
  File "C:/Users/denys/Documents/GitHub/unity_AI/brawlhalla/policy_server.py", line 166, in <module>
    ray.init(log_to_driver=False)
  File "C:\Python\lib\site-packages\ray\_private\client_mode_hook.py", line 105, in wrapper
    return func(*args, **kwargs)
  File "C:\Python\lib\site-packages\ray\worker.py", line 1022, in init
    _global_node = ray.node.Node(
  File "C:\Python\lib\site-packages\ray\node.py", line 301, in __init__
    self.start_ray_processes()
  File "C:\Python\lib\site-packages\ray\node.py", line 1130, in start_ray_processes
    resource_spec = self.get_resource_spec()
  File "C:\Python\lib\site-packages\ray\node.py", line 472, in get_resource_spec
    self._resource_spec = ResourceSpec(
  File "C:\Python\lib\site-packages\ray\_private\resource_spec.py", line 178, in resolve
    num_gpus = _autodetect_num_gpus()
  File "C:\Python\lib\site-packages\ray\_private\resource_spec.py", line 295, in _autodetect_num_gpus
    lines = subprocess.check_output(cmdargs).splitlines()[1:]
  File "C:\Python\lib\subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Python\lib\subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Python\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Python\lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Process finished with exit code 1

Here is my pip freeze:

absl-py==1.0.0
aiosignal==1.2.0
anyio==3.5.0
asgiref==3.5.0
astunparse==1.6.3
async-timeout==4.0.2
attrs==21.4.0
cachetools==5.0.0
certifi==2021.10.8
charset-normalizer==2.0.12
click==8.1.2
cloudpickle==1.2.2
colorama==0.4.4
cycler==0.11.0
Deprecated==1.2.13
distlib==0.3.4
dm-tree==0.1.7
fastapi==0.75.2
filelock==3.6.0
Flask==2.1.1
flatbuffers==2.0
fonttools==4.33.3
frozenlist==1.3.0
future==0.18.2
gast==0.5.3
google-auth==2.6.6
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.44.0
gym==0.15.3
gym-notices==0.0.6
h11==0.13.0
h5py==3.6.0
idna==3.3
imageio==2.18.0
importlib-metadata==4.11.3
importlib-resources==5.7.1
itsdangerous==2.1.2
Jinja2==3.1.1
joblib==1.1.0
jsonschema==4.4.0
keras==2.8.0
Keras-Preprocessing==1.1.2
kiwisolver==1.4.2
libclang==14.0.1
lz4==4.0.0
Markdown==3.3.6
MarkupSafe==2.1.1
matplotlib==3.5.1
mouse==0.7.1
msgpack==1.0.3
mss==6.1.0
Multi-Template-Matching==1.6.1
networkx==2.8
numpy==1.22.3
oauthlib==3.2.0
opencv-python==4.4.0.42
opencv-python-headless==4.4.0.46
opt-einsum==3.3.0
packaging==21.3
pandas==1.4.2
Pillow==9.1.0
platformdirs==2.5.2
protobuf==3.20.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pydantic==1.9.0
PyGetWindow==0.0.9
pyglet==1.3.2
pynput==1.7.6
pyparsing==3.0.8
PyRect==0.2.0
pyrsistent==0.18.1
python-dateutil==2.8.2
pytz==2022.1
PyWavelets==1.3.0
pywin32==303
PyYAML==6.0
ray==1.12.0
redis==4.2.2
requests==2.27.1
requests-oauthlib==1.3.1
rsa==4.8
scikit-image==0.17.2
scikit-learn==0.24.1
scipy==1.5.4
six==1.16.0
sniffio==1.2.0
starlette==0.17.1
tabulate==0.8.9
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.8.0
tensorflow-io-gcs-filesystem==0.25.0
termcolor==1.1.0
tf-estimator-nightly==2.8.0.dev2021122109
threadpoolctl==3.1.0
tifffile==2022.4.26
torch==1.11.0
torchvision==0.12.0
typing-extensions==4.2.0
urllib3==1.26.9
uvicorn==0.17.6
virtualenv==20.14.1
Werkzeug==2.1.1
wrapt==1.14.0
zipp==3.8.0

Sample code to produce the issue:

from gym import spaces
import ray
from ray.rllib.agents import with_common_config
from ray.rllib.agents.ppo import PPOTrainer
from ray.rllib.env import PolicyServerInput

from ray.rllib.examples.env.random_env import RandomEnv

import numpy as np
import argparse

parser = argparse.ArgumentParser(description='Optional app description')
parser.add_argument('-ip', type=str, help='IP of this device')

parser.add_argument('-checkpoint', type=str, help='location of checkpoint to restore from')

args = parser.parse_args()

DEFAULT_CONFIG = with_common_config({
    "gamma": 0.999,
    # Should use a critic as a baseline (otherwise don't use value baseline;
    # required for using GAE).
    "use_critic": True,
    # If true, use the Generalized Advantage Estimator (GAE)
    # with a value function, see https://arxiv.org/pdf/1506.02438.pdf.
    "use_gae": True,
    # The GAE (lambda) parameter.
    "lambda": 0.98,
    # Initial coefficient for KL divergence.
    "kl_coeff": 0.2,
    # Target value for KL divergence.
    "kl_target": 0.02,
    # Size of batches collected from each worker.
    "rollout_fragment_length": 64,
    # Number of timesteps collected for each SGD round. This defines the size
    # of each SGD epoch.
    "train_batch_size": 4096,
    # Total SGD batch size across all devices for SGD. This defines the
    # minibatch size within each epoch.
    "sgd_minibatch_size": 512,
    # Number of SGD iterations in each outer loop (i.e., number of epochs to
    # execute per train batch).
    "num_sgd_iter": 1,
    # Whether to shuffle sequences in the batch when training (recommended).
    "shuffle_sequences": False,
    # Stepsize of SGD.
    "lr": 3e-5,
    # Learning rate schedule.
    "lr_schedule": None,
    # Coefficient of the value function loss. IMPORTANT: you must tune this if
    # you set vf_share_layers=True inside your model's config.
    "vf_loss_coeff": 1.0,
    "model": {
        # Share layers for value function. If you set this to True, it's
        # important to tune vf_loss_coeff.
        "vf_share_layers": False,

        # VisionNetwork (tf and torch): rllib.models.tf|torch.visionnet.py
        # These are used if no custom model is specified and the input space is 2D.
        # Filter config: List of [out_channels, kernel, stride] for each filter.
        # Example:
        # Use None for making RLlib try to find a default filter setup given the
        # observation space.
        "conv_filters": [
            [16, [24, 32], [14, 18]],
            [32, [6, 6], 4],
            [256, [9, 9], 1],
        ],
        # Activation function descriptor.
        # Supported values are: "tanh", "relu", "swish" (or "silu"),
        # "linear" (or None).
        "conv_activation": "relu",

        # Some default models support a final FC stack of n Dense layers with given
        # activation:
        # - Complex observation spaces: Image components are fed through
        #   VisionNets, flat Boxes are left as-is, Discrete are one-hot'd, then
        #   everything is concated and pushed through this final FC stack.
        # - VisionNets (CNNs), e.g. after the CNN stack, there may be
        #   additional Dense layers.
        # - FullyConnectedNetworks will have this additional FCStack as well
        # (that's why it's empty by default).
        "post_fcnet_hiddens": [28],
        "post_fcnet_activation": "relu",
    },
    # Coefficient of the entropy regularizer.
    "entropy_coeff": 0.00005,
    # Decay schedule for the entropy regularizer.
    "entropy_coeff_schedule": None,
    # PPO clip parameter.
    "clip_param": 0.2,
    # Clip param for the value function. Note that this is sensitive to the
    # scale of the rewards. If your expected V is large, increase this.
    "vf_clip_param": 30.0,
    # If specified, clip the global norm of gradients by this amount.
    "grad_clip": None,
    # Whether to rollout "complete_episodes" or "truncate_episodes".
    "batch_mode": "complete_episodes",
    # Which observation filter to apply to the observation.
    "observation_filter": "NoFilter",
    # Uses the sync samples optimizer instead of the multi-gpu one. This is
    # usually slower, but you might want to try it if you run into issues with
    # # the default optimizer.
    "simple_optimizer": True,
    # "reuse_actors": True,
    "num_gpus": 1,
    # Use the connector server to generate experiences.
    "input": (
        lambda ioctx: PolicyServerInput(ioctx, args.ip, 55556)
    ),
    # Use a single worker process to run the server.
    "num_workers": 0,
    # Disable OPE, since the rollouts are coming from online clients.
    "input_evaluation": [],
    # "callbacks": MyCallbacks,
    "env": RandomEnv,
    "env_config": {
        "sleep": True
    },
    "framework": "tf",
    # "eager_tracing": True,
    "explore": True,
    # "exploration_config": {
    #     "type": "Curiosity",  # <- Use the Curiosity module for exploring.
    #     "eta": 0.6,  # Weight for intrinsic rewards before being added to extrinsic ones.
    #     "lr": 0.001,  # Learning rate of the curiosity (ICM) module.
    #     "feature_dim": 1152, # Dimensionality of the generated feature vectors.
    #     # Setup of the feature net (used to encode observations into feature (latent) vectors).
    #     "inverse_net_hiddens": [64, 128], # Hidden layers of the "inverse" model.
    #     "inverse_net_activation": "relu",  # Activation of the "inverse" model.
    #     "forward_net_hiddens": [64, 128],  # Hidden layers of the "forward" model.
    #     "forward_net_activation": "relu",  # Activation of the "forward" model.
    #     "beta": 0.2,  # Weight for the "forward" loss (beta) over the "inverse" loss (1.0 - beta).
    #     # Specify, which exploration sub-type to use (usually, the algo's "default"
    #     # exploration, e.g. EpsilonGreedy for DQN, StochasticSampling for PG/SAC).
    #     "sub_exploration": {
    #         "type": "StochasticSampling",
    #     }
    # },
    "create_env_on_driver": False,
    "log_sys_usage": False,
    # "normalize_actions": False,
    "compress_observations": True,
    # Whether to fake GPUs (using CPUs).
    # Set this to True for debugging on non-GPU machines (set `num_gpus` > 0).
    "_fake_gpus": True
})

DEFAULT_CONFIG["env_config"]["observation_space"] = spaces.Box(low=0, high=255,
                                                               shape=(480, 640, 3), dtype=np.uint8)

DEFAULT_CONFIG["env_config"]["action_space"] = spaces.MultiDiscrete(
    [
        2,  # W
        2,  # A
        2,  # S
        2,  # D
        2,  # Space
        2,  # H
        2,  # J
        2,  # K
        2  # L
    ]
)

ray.init(log_to_driver=False)


trainer = PPOTrainer


from ray import tune

name = "" + args.checkpoint
print(f"Starting: {name}")
tune.run(trainer,
         # resume = True,
         config=DEFAULT_CONFIG, name=name, keep_checkpoints_num=None, checkpoint_score_attr="episode_reward_mean",
         max_failures=1,
         # restore="C:\\Users\\ashyk\\ray_results\\TEST_32k-batch_512-len_32_Run-2\\PPO_RandomEnv_46610_00000_0_2021-12-31_17-30-37\\checkpoint_000027\\checkpoint-27",
         checkpoint_freq=1, checkpoint_at_end=True)

Thanks in advance!

Hey @Denys_Ashikhin ,

I’m not on Windows and your script runs fine on my MacBook.
Since this seems to be windows specific, I can only guess:
Your script wants an ip. If you don’t provide the IP, you create the PolicyServerInput at ip=None. Maybe this leads to such an issue?

I’m sorry I can only provide a wild guess here. If the issue persists: Could you please open an issue on GitHub with your repro script? This way someone from the team with windows access deals with this and we can better track this.

Cheers :slight_smile:

Hi,

I do provide an IP so unfortunately it’s not that.
I did open an issue at:_winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] · Issue #24358 · ray-project/ray · GitHub

Fingers crossed I can get a response soon

1 Like

Hey @arturn , it’s been a while and I have yet to get any responses, any chance you could prod someone to take a look?

Thanks!

@sven1977 will have a look at the forums today I think!

1 Like

Hey @Denys_Ashikhin , I just ran your script from above on my Win PC using the latest master, but I also cannot reproduce the issue. The script runs totally fine and doesn’t throw any errors. Maybe this is something we fixed recently in Ray Core (past 1.12)? If so, you can either wait a few more days on 1.13 or use the latest master wheel (which is what I was doing).

Where do I get the latest master wheel for windows?
Currently I am using this: Installing Ray — Ray 1.12.0 and going down to latest windows section (3.8)

https://docs.ray.io/en/latest/ray-overview/installation.html#daily-releases-nightlies

So I tried the following I deleted my current installation of python and tried the following:

pip install -U ray[default] https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl Collecting ray==2.0.0.dev0
with the latest python 3.9.12 and got the following error:

C:\Windows\system32>pip install -U ray[default] https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl
Collecting ray==2.0.0.dev0
  Downloading https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl (20.4 MB)
     ---------------------------------------- 20.4/20.4 MB 807.4 kB/s eta 0:00:00
Collecting ray[default]
  Downloading ray-1.12.0-cp39-cp39-win_amd64.whl (19.9 MB)
     ---------------------------------------- 19.9/19.9 MB 3.8 MB/s eta 0:00:00
  Downloading ray-1.11.1-cp39-cp39-win_amd64.whl (19.4 MB)
     ---------------------------------------- 19.4/19.4 MB 3.8 MB/s eta 0:00:00
  Downloading ray-1.11.0-cp39-cp39-win_amd64.whl (19.4 MB)
     ---------------------------------------- 19.4/19.4 MB 3.9 MB/s eta 0:00:00
  Downloading ray-1.10.0-cp39-cp39-win_amd64.whl (22.8 MB)
     ---------------------------------------- 22.8/22.8 MB 3.7 MB/s eta 0:00:00
  Downloading ray-1.9.2-cp39-cp39-win_amd64.whl (21.3 MB)
     ---------------------------------------- 21.3/21.3 MB 3.8 MB/s eta 0:00:00
  Downloading ray-1.9.1-cp39-cp39-win_amd64.whl (21.3 MB)
     ---------------------------------------- 21.3/21.3 MB 3.9 MB/s eta 0:00:00
  Downloading ray-1.9.0-cp39-cp39-win_amd64.whl (21.3 MB)
     ---------------------------------------- 21.3/21.3 MB 3.7 MB/s eta 0:00:00
  Downloading ray-1.8.0-cp39-cp39-win_amd64.whl (18.3 MB)
     ---------------------------------------- 18.3/18.3 MB 4.0 MB/s eta 0:00:00
  Downloading ray-1.7.0-cp39-cp39-win_amd64.whl (18.1 MB)
     ---------------------------------------- 18.1/18.1 MB 3.8 MB/s eta 0:00:00
  Downloading ray-1.6.0-cp39-cp39-win_amd64.whl (15.6 MB)
     ---------------------------------------- 15.6/15.6 MB 3.9 MB/s eta 0:00:00
  Downloading ray-1.5.2-cp39-cp39-win_amd64.whl (15.9 MB)
     ---------------------------------------- 15.9/15.9 MB 4.0 MB/s eta 0:00:00
  Downloading ray-1.5.1-cp39-cp39-win_amd64.whl (15.9 MB)
     ---------------------------------------- 15.9/15.9 MB 3.9 MB/s eta 0:00:00
  Downloading ray-1.5.0-cp39-cp39-win_amd64.whl (15.9 MB)
     ---------------------------------------- 15.9/15.9 MB 3.7 MB/s eta 0:00:00
  Downloading ray-1.4.1-cp39-cp39-win_amd64.whl (15.7 MB)
     ---------------------------------------- 15.7/15.7 MB 3.9 MB/s eta 0:00:00
ERROR: Cannot install ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl), ray[default]==1.10.0, ray[default]==1.11.0, ray[default]==1.11.1, ray[default]==1.12.0, ray[default]==1.4.1, ray[default]==1.5.0, ray[default]==1.5.1, ray[default]==1.5.2, ray[default]==1.6.0, ray[default]==1.7.0, ray[default]==1.8.0, ray[default]==1.9.0, ray[default]==1.9.1 and ray[default]==1.9.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.12.0 depends on ray 1.12.0 (from https://files.pythonhosted.org/packages/ff/c8/a7b6f646b71c25af094ef9f017a4fefc8e5852ea6c8ec00b90e5c1b838f7/ray-1.12.0-cp39-cp39-win_amd64.whl#sha256=b172a2f97b1372b7599ee089978f67c596a67eaabe292c15c6a2b4a1b673f62f (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.11.1 depends on ray 1.11.1 (from https://files.pythonhosted.org/packages/48/9f/0d4ff44316bf4f7965335388b6551981ef4316e26db7d8f33f575cf6de2b/ray-1.11.1-cp39-cp39-win_amd64.whl#sha256=da2c79543a0f690b5bebd8debaa099c57afc47f3fe3dc937293ad0946b509d10 (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.11.0 depends on ray 1.11.0 (from https://files.pythonhosted.org/packages/72/67/a9ae8cb11cd1e77d829df6a23969da45b9f7399cd60f0c4cda28a4c20a78/ray-1.11.0-cp39-cp39-win_amd64.whl#sha256=534b18b39b8b1b44d48ca377b2819857bda89c8d2031eed0b280a7b493462a0c (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.10.0 depends on ray 1.10.0 (from https://files.pythonhosted.org/packages/d8/cd/42cd35ac8e8ad03becc2e43184be64727177742b3e3a30431ed98902d862/ray-1.10.0-cp39-cp39-win_amd64.whl#sha256=db953540f0f7e5e666d263f847b45ad368e9de5ad02da9df4e9e5ee508d5d6b6 (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.9.2 depends on ray 1.9.2 (from https://files.pythonhosted.org/packages/22/d4/651789cddeebd7f68247dc9b03f2d4882434cfa6d8047e73172d307e7a82/ray-1.9.2-cp39-cp39-win_amd64.whl#sha256=a9de944bd0dc4d553d10eb31efba4eab508f65289c5595ab56df44f65810d9dd (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.9.1 depends on ray 1.9.1 (from https://files.pythonhosted.org/packages/f4/8b/e5ee9ff0a65282b5a285e3351a9c23c8b1c9feb8f03c321965cc63ea914c/ray-1.9.1-cp39-cp39-win_amd64.whl#sha256=e1bf6e79c476677675ffb6cb5512df3d993f4c209bcf7a6607c8c10b8d8ff2ab (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.9.0 depends on ray 1.9.0 (from https://files.pythonhosted.org/packages/99/a5/462488643cab12aceda6277d7e6a60a6074f1c6b1c50bc5a196c0a5373c0/ray-1.9.0-cp39-cp39-win_amd64.whl#sha256=3f93deb83f94ebf4e99fc6169f34973587d22baaebc3b1054572bc770820d60c (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.8.0 depends on ray 1.8.0 (from https://files.pythonhosted.org/packages/ab/ec/b2a9735f9a5b84770929d80ba335bfe1d4f87f25040e1dc4cf8f05f08226/ray-1.8.0-cp39-cp39-win_amd64.whl#sha256=8bd9a2beb0594555d74907d2a390a050d4dd08158409ef0d64c1bf9fceeb149c (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.7.0 depends on ray 1.7.0 (from https://files.pythonhosted.org/packages/75/a9/1b4836380660156964dc26bc2038c1c1b084bbaa7434150f3b9c510f4e66/ray-1.7.0-cp39-cp39-win_amd64.whl#sha256=ab12fd3381721776e0121b68194df6a15264803fc39935af3de0e5b6d7987e3b (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.6.0 depends on ray 1.6.0 (from https://files.pythonhosted.org/packages/f1/b4/53e68b5873287828e747a3c0f605db807e8e16dfbeaf41bca5e1bdc7359f/ray-1.6.0-cp39-cp39-win_amd64.whl#sha256=5a684eb6a990f8e03fad2ee1259644e9d484ddbe5560ac4407264ec9b8066d82 (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.5.2 depends on ray 1.5.2 (from https://files.pythonhosted.org/packages/cc/ca/a8cfc5bf2031b6c88d028f3eab1e460e9d1ef60da06ead16baae7cf064b5/ray-1.5.2-cp39-cp39-win_amd64.whl#sha256=1d663277bce5405b9e8a9d165f7fc544c6347191c89486c58dcbad66df4a435a (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.5.1 depends on ray 1.5.1 (from https://files.pythonhosted.org/packages/d7/bd/5967980c6ffe8a60d4bd04a7595936d5dc5a160529a799cd94da6073dced/ray-1.5.1-cp39-cp39-win_amd64.whl#sha256=8cdf7c341f8d1f8c20fe35fd2025880801f619fee38022ea615efb1035e03826 (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.5.0 depends on ray 1.5.0 (from https://files.pythonhosted.org/packages/7b/1f/ec6402c1a5c12e63700bb8988bd98b086fcb89018a15da70c251ad9f6ad9/ray-1.5.0-cp39-cp39-win_amd64.whl#sha256=49132e7e10fc8b36d0c4b81490b343a9fcaacd6a500b0be5cbcc60d4f11b3350 (from https://pypi.org/simple/ray/))
    The user requested ray 2.0.0.dev0 (from https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl)
    ray[default] 1.4.1 depends on ray 1.4.1 (from https://files.pythonhosted.org/packages/eb/64/67f973a95538a976fba2eb80d3259a12753f11d63d73eeec9be244915f4c/ray-1.4.1-cp39-cp39-win_amd64.whl#sha256=6f00c78ea3468417cdb38ce488efea910182391903f8b3b3f3faa721a1aab221 (from https://pypi.org/simple/ray/))

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the 'C:\Users\denys\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.

C:\Windows\system32>

So I instead tried just the
pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp39-cp39-win_amd64.whl Collecting ray==2.0.0.dev0

And ran the following to get the same error:

C:\Users\denys\Documents\GitHub\unity_AI\brawlhalla>python policy_server.py -ip=localhost -checkpoint=brawl
Traceback (most recent call last):
  File "C:\Users\denys\Documents\GitHub\unity_AI\brawlhalla\policy_server.py", line 166, in <module>
    ray.init(log_to_driver=False)
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\_private\client_mode_hook.py", line 105, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\worker.py", line 1047, in init
    _global_node = ray.node.Node(
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\node.py", line 300, in __init__
    self.start_ray_processes()
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\node.py", line 1123, in start_ray_processes
    resource_spec = self.get_resource_spec()
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\node.py", line 462, in get_resource_spec
    self._resource_spec = ResourceSpec(
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\_private\resource_spec.py", line 178, in resolve
    num_gpus = _autodetect_num_gpus()
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\_private\resource_spec.py", line 295, in _autodetect_num_gpus
    lines = subprocess.check_output(cmdargs).splitlines()[1:]
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\denys\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

C:\Users\denys\Documents\GitHub\unity_AI\brawlhalla>

This time I for sure used latest python and nightly windows release (for 3.9).

I also tested on a different computer, and get the same issue

So I managed to resolve the issue thankfully, it seems like my path variables got messed up somehow, just to be safe (and I don’t feel like investigating further, I had to add the following both my user and system PATH variable:

%SystemRoot%\System32
%SystemRoot%\System32\Wbem
%SystemRoot%\System32\wbem

after this ray launches fine for me. Just to note, I already had C:\Windows\System32 in there, but seems like it wasn’t enough…

1 Like