modin with ray for pandas在命令提示符下工作,但没有闲置,没有错误代码

发布于 2025-02-03 19:22:08 字数 827 浏览 4 评论 0原文

我尝试使用pandas的modin Unstead来“通过更改一行代码来并行化” 我正在使用空闲,运行此代码时:

import os
os.environ["MODIN_ENGINE"] = "ray"    
import ray
ray.init()
import modin.pandas as pd
pd.read_csv("some_path")

某些命令提示符打开并关闭(他们的路径是指射线),然后行: ======================================================= =====================没有错误代码,所以我不知道怎么了) 之后,无论pandas命令我都尝试在空闲窗口中运行,我会收到错误“ nameError:name'pd'未定义”。

问题似乎来自空闲,因为我试图直接从命令提示符下运行它,并且代码按预期运行。

因此,我尝试了所有失败的解决方案:

- 计算机重新启动

- 检查是否有几个python安装

- 安装,重新安装了重新安装的所有模块

- 完全安装了完全python并重新安装(3.9)

我发现log log log of log of log of log of log of log and log of Ray and and log of Ray,并且根本原因在dashboard_agent.log中记录

在每个运行中并未保存所引用的日志,但我找到了其中2个,他们警告了一个缺少的模块。

我安装了缺少的模块,多次重新运行脚本,并且该脚本仍无法正常工作,日志仍在指我尝试运行代码时不再生成的日志,至少在20次尝试中。

I try to use modin unstead of pandas to "parallelize by changing a single line of code"
I'm using IDLE and when I run this code :

import os
os.environ["MODIN_ENGINE"] = "ray"    
import ray
ray.init()
import modin.pandas as pd
pd.read_csv("some_path")

Some command prompt windows open and close (their path refers to ray), then the line :
================================ RESTART: Shell ================================ is shown (with no error code so I can't know what went wrong)
After that whatever the pandas command I try to run in the IDLE window, I get the error "NameError : name 'pd' is not defined".

The problem seems to come from IDLE, because I tried to run it directly from command prompt, and the code worked as intended.

So i tried theese solutions, that all failed :

-Computer reboots

-Check if there was several python installations

-Uninstalling, redownloading an reinstalling all modules

-Uninstalled completely python and reinstalling (3.9)

I found log saying the error comes from ray, and that the root cause is logged in dashboard_agent.log

The refered log is not saved at each run, but I found 2 of them and they warn about a missing module.

I installed the missing module, re-ran the script multiple times, and the script is still not working, the logs are still referring to a log that is no longer generated when I try to run the code,at least in 20 attempts .

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽清梦 2025-02-10 19:22:08

在子过程失败时,似乎会iDLE给出重新启动消息,请参见 https://stackoverflow.com/a/a/a/a/29216224/19024/190277728 。为了澄清,当您运行空转外壳时,这会发生这种情况,而不是从命令提示符中?在命令提示符运行中,您是在运行脚本即python脚本还是在交互方式运行python?您是否尝试过像Ipython这样的另一个外壳运行它?

从您的调试步骤中,这似乎是一个射线问题。要确认,您可以尝试使用Dask运行吗?如果您使用modin [all]安装了该后端。如果没有,PIP安装Modin [dask]应该起作用。

如果使用射线是必需的,您是否可以尝试分享其中一些Ray调试日志?另外,请确保在适当的情况下调用ray.shutdown()以避免产卵冗余射线实例,这可能会导致问题。

It appears IDLE gives the RESTART message when a subprocess fails, see https://stackoverflow.com/a/29216224/19027728. To clarify, this happens when you are running the IDLE shell, but not from command prompt? In the command prompt run, are you running a script ie python script.py or are you running python interactively? Have you tried running this with another shell, like IPython?

From your debugging steps, it appears it might be a Ray issue. To confirm, can you try running with Dask instead? If you installed with modin[all] you should have that backend. If not, pip install modin[dask] should work.

If using Ray is a necessity, could you perhaps try sharing some of those Ray debug logs? Also, make sure to call ray.shutdown() when appropriate to avoid spawning redundant Ray instances, which might cause issues.

凯凯我们等你回来 2025-02-10 19:22:08

杰弗里·李(Jeffrey Li)对重新启动消息是正确的,表明idle的执行子进程崩溃了。命令行Python的差异可能是执行环境通过空闲执行时略有不同。 (任何GUI替代方案都是如此。)我的其他建议。

  1. 阅读空闲文档的运行用户代码部分。它可以在空闲的帮助菜单上找到。一个人可以使用sys来研究上述差异。

  2. 从命令行中运行空闲,如果还没有这样做,则使用python -m idlelib,其中python适用于您的OS和Python版本。这使执行环境与标准环境更相似。因此,a)您可能会在终止订阅的终端上收到一条错误消息,而b)您编程的行为可能更好。

  3. 对于当前,通过直接在没有modin的情况下直接运行大熊猫来开发熊猫应用程序。我只知道后者似乎是可选的优化器。我知道,直接运行时,熊猫的某些部分至少可以闲置。

Jeffrey Li is correct about the restart message indicating that IDLE's execution subprocess crashed. The difference from command line Python may be that the execution environment is slightly different when execution via IDLE. (This will be true of any GUI alternative.) My additional suggestions.

  1. Read the Running user code section of the IDLE doc. It is available on IDLE's help menu. One can use sys to investigate the differences mentioned.

  2. Run IDLE from a command line, if not doing so already, with python -m idlelib, where python is adjusted as appropriate for your OS and Python version. The makes the execution environment more similar to the standard environment. So a) you may get an error message on the terminal where you start IDLE and b) you program might behave better.

  3. For the present, develop your pandas application by running pandas directly, without modin. All I know of the latter is that it appears to be an optional optimizer. I know that at least some parts of pandas run fine with IDLE when run directly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文