1

After installing modin on my Windows machine (pip install modin[ray]), I can run simple examples on a jupyter notebook, but it fails when running from PyCharm. I get an exception: Unable to connect to Redis. Any suggestion?

### 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.
Pebeto
  • 140
  • 5
  • What have you done so far? Have you looked up the package in question? Is Redis installed and accessible in your current project environment? – NotAName Oct 19 '20 at 23:23
  • As I mentioned above, I installed modin using pip. When I run a Jupyter notebook, it works. On the console in Pycharm, if I try to import modin.pandas, it fails and I get a RuntimeError. I looked at sys.path and they point to the same site-package – Pebeto Oct 20 '20 at 02:19
  • Jupyter normally uses global packages, but for PyCharm you need for the specific module to be available in project environment. Go to File-> Settings-> Project -> Python Interpreter and see whether `redis` appears in the list of packages. If it's not there you either need to install it into the environment or use global environment. – NotAName Oct 20 '20 at 02:40
  • ray, dask, and redit are installed, and I am actually using the global environment, not a virtual one – Pebeto Oct 20 '20 at 03:03
  • Is there a chance that your versions are conflicting? Can you include the full error message? – NotAName Oct 20 '20 at 06:26
  • Not sure. I found a thread somewhere mentioning that modin could work with Pycharm in a virtual environment. I will try that later. Otherwise, I updated the post above – Pebeto Oct 20 '20 at 15:36
  • Probably a bit of updated information can help here. I am running Windows 11 and with Python 3.7, Use System interpreter and not Virtual Environment. With venv it fails but with system interpreter it runs fine. – leonardo May 07 '22 at 03:31

0 Answers0