目前共有6篇帖子。 字體大小:較小 - 100% (默認)▼  內容轉換:不轉換▼
 
點擊 回復
27 5
OSError: [Errno 0] AssignProcessToJobObject() failed
一派掌門 二十級
1樓 發表于:2026-5-19 19:21
Microsoft Windows [版本 10.0.26200.8457]
(c) Microsoft Corporation。保留所有权利。

C:\Users\qwert2180>cd D:\资料\2026-5

C:\Users\qwert2180>d:

D:\资料\2026-5>python3 ray_test.py
Traceback (most recent call last):
  File "D:\资料\2026-5\ray_test.py", line 8, in <module>
    futures = [square.remote(i) for i in range(4)]
               ^^^^^^^^^^^^^^^^
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\remote_function.py", line 164, in _remote_proxy
    return self._remote(
           ^^^^^^^^^^^^^
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\auto_init_hook.py", line 21, in auto_init_wrapper
    auto_init_ray()
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\auto_init_hook.py", line 15, in auto_init_ray
    ray.init()
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\client_mode_hook.py", line 107, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\worker.py", line 1905, in init
    _global_node = ray._private.node.Node(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\node.py", line 399, in __init__
    self.start_head_processes()
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\node.py", line 1343, in start_head_processes
    self.start_monitor()
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\node.py", line 1254, in start_monitor
    process_info = ray._private.services.start_monitor(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\services.py", line 2377, in start_monitor
    process_info = start_ray_process(
                   ^^^^^^^^^^^^^^^^^^
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\services.py", line 1056, in start_ray_process
    ray._private.utils.set_kill_child_on_death_win32(process)
  File "C:\Users\qwert2180\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\ray\_private\utils.py", line 847, in set_kill_child_on_death_win32
    raise OSError(ctypes.get_last_error(), "AssignProcessToJobObject() failed")
OSError: [Errno 0] AssignProcessToJobObject() failed

D:\资料\2026-5>

一派掌門 二十級
2樓 發表于:2026-5-19 19:22

【ray_test.py】

#!/bin/python3
import ray

@ray.remote
def square(x):
    return x * x
    
futures = [square.remote(i) for i in range(4)]
print(ray.get(futures))

 
一派掌門 二十級
3樓 發表于:2026-5-19 19:40
 
巨大八爪鱼

thomasbbrunner

on Feb 19, 2024

I can also confirm that I faced the mentioned issue when using Python 3.10 from the Microsoft Store.

By downloading Python 3.10 from the official website, I was able to use Ray without any problem (so far).

  2026-5-19 19:57 回復
一派掌門 二十級
4樓 發表于:2026-5-19 19:59

原因:Python是从Microsoft Store安装的,不是用Python官网下载的安装包安装的。

解决方案:卸载Microsoft Store里面安装的Python,重新去Python官网下载Python 3.10的安装包安装Python。

 
一派掌門 二十級
5樓 發表于:2026-5-20 15:19

问题解决了。

Microsoft Windows [版本 10.0.26200.8457]

(c) Microsoft Corporation。保留所有权利。

C:\Users\qwert2180>cd D:\资料\2026-5

C:\Users\qwert2180>d:

D:\资料\2026-5>python ray_test.py
2026-05-20 15:19:08,552 INFO worker.py:2003 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265
C:\Users\qwert2180\AppData\Local\Programs\Python\Python310\lib\site-packages\ray\_private\worker.py:2051: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0
  warnings.warn(
[0, 1, 4, 9]

D:\资料\2026-5>

 

回復帖子

內容:
用戶名: 您目前是匿名發表
驗證碼:
(快捷鍵:Ctrl+Enter)
 

本帖信息

點擊數:27 回複數:5
評論數: ?
作者:巨大八爪鱼
最後回復:巨大八爪鱼
最後回復時間:2026-5-20 15:19
 
©2010-2026 Purasbar Ver2.0
除非另有聲明,本站採用創用CC姓名標示-相同方式分享 3.0 Unported許可協議進行許可。