# Ray unable to find worker.py due to spaces in filepath - Windows

**URL:** https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591
**Category:** Ray Core
**Created:** [March 2, 2023, 7:34am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591 "2023-03-02T07:34:08Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ShawnH91](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@ShawnH91](https://discuss.ray.io/u/ShawnH91)
#### Post date: [March 2, 2023, 7:34am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/1 "2023-03-02T07:34:08Z")

</div>

- High: It blocks me to complete my task.

When calling tune.run() I get the following warning.

(raylet) Path\Python\Python310\python.exe: can’t open file ‘Path with spaces’\venv\lib\site-packages\ray\_private\workers\default\_worker.py’: [Errno 2] No such file or directory  
(raylet) [2023-03-02 18:30:01,992 E 124388 36360] (raylet.exe) worker\_pool.cc:525: Some workers of the worker process(130296) have not registered within the timeout. The process is dead, probably it crashed during start.

It is treating each space as a new folder. I am using Ray 2.3.0 and Pycharm 2022.2.3

Can anyone tell me how to fix this? (if you need more information please let me know)

---

<div class="post-metadata">

### Author: ![Magnus\_Muller](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/magnus_muller/32/4013_2.png) [@Magnus\_Muller](https://discuss.ray.io/u/Magnus_Muller)
#### Post date: [March 4, 2023, 4:22pm UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/2 "2023-03-04T16:22:11Z")

</div>

I face the same issue, every thing worked until now fine

---

<div class="post-metadata">

### Author: ![Huaiwei\_Sun](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/huaiwei_sun/32/1316_2.png) [@Huaiwei\_Sun](https://discuss.ray.io/u/Huaiwei_Sun)
#### Post date: [March 4, 2023, 7:11pm UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/3 "2023-03-04T19:11:21Z")

</div>

cc: @justinvyu @matthewdeng for thoughts.

@ShawnH91 could you modify the category to “Ray AIR”? This topic is a better fit there.

---

<div class="post-metadata">

### Author: ![ShawnH91](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@ShawnH91](https://discuss.ray.io/u/ShawnH91)
#### Post date: [March 6, 2023, 3:29am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/4 "2023-03-06T03:29:44Z")

</div>

@Huaiwei_Sun I can’t seem to work out how to change the category, do I just need to recreate it in the right category and then delete this?

---

<div class="post-metadata">

### Author: ![Huaiwei\_Sun](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/huaiwei_sun/32/1316_2.png) [@Huaiwei\_Sun](https://discuss.ray.io/u/Huaiwei_Sun)
#### Post date: [March 6, 2023, 5:24am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/5 "2023-03-06T05:24:07Z")

</div>

This is how I change the category of my post

 ![Screen Shot 2023-03-05 at 9.22.33 PM](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/1/193c2061375d7281cc89510b485178c799d38b68.png)  
 ![Screen Shot 2023-03-05 at 9.22.39 PM](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/4/4b78c916413d198616c7fdb119ded6553809f7d9.png)

---

<div class="post-metadata">

### Author: ![Magnus\_Muller](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/magnus_muller/32/4013_2.png) [@Magnus\_Muller](https://discuss.ray.io/u/Magnus_Muller)
#### Post date: [March 6, 2023, 7:50am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/6 "2023-03-06T07:50:54Z")

</div>

Reproduction script

```auto
from ray import tune
from ray.rllib.algorithms.ppo import PPOConfig

ppo_config = (PPOConfig().framework("torch").environment("CartPole-v0"))
tuner = tune.Tuner(
        "PPO",
        param_space=ppo_config.to_dict(),
    )
tuner.fit()

```

Windows 11  
Python 3.10.9  
Gymnasium 0.26.3  
ray 2.3.0  
torch-scatter torch-sparse torch-geometric -f [https://data.pyg.org/whl/torch-1.13.1+cu117.html](https://data.pyg.org/whl/torch-1.13.1+cu117.html)  
torch==1.13.1+cu117 -f [https://download.pytorch.org/whl/torch\_stable.html](https://download.pytorch.org/whl/torch_stable.html)

Error:

```auto
(raylet) C:\Users\Magnus Mueller\AppData\Local\Programs\Python\Python310\python.exe: can't open file 'C:\\Users\\Magnus\\ Mueller\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\ray\\_private\\workers\\default_worker.py': [Errno 2] No such file or directory

```

---

<div class="post-metadata">

### Author: ![ShawnH91](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@ShawnH91](https://discuss.ray.io/u/ShawnH91)
#### Post date: [March 6, 2023, 8:15pm UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/7 "2023-03-06T20:15:32Z")

</div>

I don’t have an edit option displaying when I open this topic.

---

<div class="post-metadata">

### Author: ![matthewdeng](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/matthewdeng/32/1446_2.png) [@matthewdeng](https://discuss.ray.io/u/matthewdeng)
#### Post date: [March 6, 2023, 9:14pm UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/8 "2023-03-06T21:14:47Z")

</div>

Hey @ShawnH91, can you share what `‘Path with spaces’` is?

**Edit:** Oh, I see what you mean, it’s the directory that contains `env/`.

Can you try reproducing this with a simpler script? I think this may be a Ray Core issue.

```python
import ray

ray.init()

@ray.remote
def f():
    return 1

ray.get(f.remote())

```

Also, could you share the full trace where it fails?

cc @jjyao

---

<div class="post-metadata">

### Author: ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)
#### Post date: [March 8, 2023, 7:48am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/9 "2023-03-08T07:48:51Z")

</div>

Hey @Magnus_Muller , could it just be that one of your directories contains a space?  
It’s trying to find “…\Magnus\ Mueller…” possibly thinking that " Mueller" is a subdir under “Magnus”. I’m not sure either, but on my Win PC, the repro script (thanks for providing this btw!) works fine.

---

<div class="post-metadata">

### Author: ![Magnus\_Muller](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/magnus_muller/32/4013_2.png) [@Magnus\_Muller](https://discuss.ray.io/u/Magnus_Muller)
#### Post date: [March 8, 2023, 11:16am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/10 "2023-03-08T11:16:29Z")

</div>

You are absolutely right.  
The problem is, that my username has a space (That’s just possible on Windows), and I do not have the permissions to change that. So maybe we could escape spaces in the path correctly.

---

<div class="post-metadata">

### Author: ![Alexander\_Limonov](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/alexander_limonov/32/4040_2.png) [@Alexander\_Limonov](https://discuss.ray.io/u/Alexander_Limonov)
#### Post date: [April 25, 2023, 8:58am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/11 "2023-04-25T08:58:14Z")

</div>

I am having the same issue here. The problem is that I have a space in one of the folders in the path. Is there any update on this?

---

<div class="post-metadata">

### Author: ![Ammar\_Hafeez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ammar_hafeez/32/4627_2.png) [@Ammar\_Hafeez](https://discuss.ray.io/u/Ammar_Hafeez)
#### Post date: [June 22, 2023, 10:45am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/12 "2023-06-22T10:45:43Z")

</div>

I am having the same issue here. The problem is that I have a space in one of the folders in the path. Is there any update on this?

---

<div class="post-metadata">

### Author: ![mirajull](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mirajull/32/5334_2.png) [@mirajull](https://discuss.ray.io/u/mirajull)
#### Post date: [November 14, 2023, 8:02am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/13 "2023-11-14T08:02:59Z")

</div>

I could fix this issue by commenting out the following line from ray\_private\runtime\_env\context.py

passthrough\_args = [s.replace(" “, r”\ ") for s in passthrough\_args]

(line 70 for ray 2.6.3)

---

<div class="post-metadata">

### Author: ![mirajull](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mirajull/32/5334_2.png) [@mirajull](https://discuss.ray.io/u/mirajull)
#### Post date: [November 14, 2023, 8:03am UTC](https://discuss.ray.io/t/ray-unable-to-find-worker-py-due-to-spaces-in-filepath-windows/9591/14 "2023-11-14T08:03:59Z")

</div>

You can follow my comment
