ray.init() 时出现 PermissionError

PermissionError when ray.init()

提问人:BobCheng 提问时间:11/17/2023 最后编辑:CowBobCheng 更新时间:11/17/2023 访问量:18

问:

我将 conda 环境克隆到新计算机,并运行了一个 ray 项目,但遇到了错误。我发现当ray.init()时发生此错误,详细代码和信息如下:

>>> import ray
>>> ray.init()
2023-11-17 17:26:16,023 INFO resource_spec.py:212 -- Starting Ray with 33.89 GiB memory available for workers and up to 16.97 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/worker.py", line 767, in init
    ray_params=ray_params)
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/node.py", line 177, in __init__
    self.start_head_processes()
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/node.py", line 649, in start_head_processes
    self.start_redis()
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/node.py", line 473, in start_redis
    fate_share=self.kernel_fate_share)
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/services.py", line 769, in start_redis
    fate_share=fate_share)
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/services.py", line 943, in _start_redis_instance
    fate_share=fate_share)
  File "/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/services.py", line 514, in start_ray_process
    preexec_fn=preexec_fn if sys.platform != "win32" else None)
  File "/root/anaconda3/envs/ncd/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/root/anaconda3/envs/ncd/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/root/anaconda3/envs/ncd/lib/python3.7/site-packages/ray/core/src/ray/thirdparty/redis/src/redis-server'

我检查了文件权限,但仍然不知道问题出在哪里。drwxr-xr-x 12 root root 4096 Nov 17 16:53 ncd

我想修复权限错误。

蟒蛇 redis anaconda conda ray

评论

0赞 Melon Pie 11/17/2023
您是否使用用户“root”运行 python cli?
0赞 BobCheng 11/17/2023
是的,我是root用户。也许没有足够的缓存来存储光线?

答:

1赞 BobCheng 11/17/2023 #1

我使用“chmod 777”命令手动修改所有提示文件的权限。问题就解决了。