1

在我的 Windows 机器上安装 modin (pip install modin[ray]) 后,我可以在 jupyter notebook 上运行简单的示例,但从 PyCharm 运行时会失败。我得到一个例外:无法连接到 Redis。有什么建议吗?

### Read in the data with Pandas
import pandas as pd

s = time.time()
df = pd.read_csv("esea_master_dmg_demos.part1.csv")
e = time.time()
print("Pandas Loading Time = {}".format(e-s))

### Read in the data with Modin
import modin.pandas as pd

s = time.time()
df = pd.read_csv("esea_master_dmg_demos.part1.csv")
e = time.time()
print("Modin Loading Time = {}".format(e-s))
Traceback (most recent call last):
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\IPython\core\interactiveshell.py", line 3417, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-6-7e7b44bd7fd7>", line 1, in <module>
    import modin.pandas as pd
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\pandas\__init__.py", line 182, in <module>
    execution_engine.subscribe(_update_engine)
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\__init__.py", line 93, in subscribe
    callback(self)
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\pandas\__init__.py", line 118, in _update_engine
    initialize_ray()
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\modin\engines\ray\utils.py", line 139, in initialize_ray
    ray.init(
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\worker.py", line 696, in init
    _global_node = ray.node.Node(
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\node.py", line 198, in __init__
    self.start_head_processes()
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\node.py", line 800, in start_head_processes
    self.start_redis()
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\node.py", line 568, in start_redis
    process_infos) = ray.services.start_redis(
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\services.py", line 739, in start_redis
    port, p = _start_redis_instance(
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\services.py", line 937, in _start_redis_instance
    wait_for_redis_to_start("127.0.0.1", port, password=password)
  File "xxx\AppData\Local\Programs\Python\Python38\lib\site-packages\ray\services.py", line 552, in wait_for_redis_to_start
    raise RuntimeError("Unable to connect to Redis. If the Redis instance "
RuntimeError: Unable to connect to Redis. If the Redis instance is on a different machine, check that your firewall is configured properly.
4

0 回答 0