# Install modin or any pip package on ray cluster

**URL:** <https://discuss.ray.io/t/install-modin-or-any-pip-package-on-ray-cluster/2783>\
**Category:** Ray Clusters\
**Created:** [July 5, 2021, 4:00pm UTC](https://discuss.ray.io/t/install-modin-or-any-pip-package-on-ray-cluster/2783 "2021-07-05T16:00:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mofef](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mofef/32/1253_2.png) [@Mofef](https://discuss.ray.io/u/Mofef)\
**Post date:** [July 5, 2021, 4:00pm UTC](https://discuss.ray.io/t/install-modin-or-any-pip-package-on-ray-cluster/2783/1 "2021-07-05T16:00:40Z")

</div>

- I installed ray on a kubernetes cluster with helm and managed to connect to it with ray.client.
- I added

```auto
setup_commands:
    - pip install modin[ray]

```

to ray/python/ray/autoscaler/kubernetes/example-full.yaml and did `ray up`

- i’m able to connect to the ray cluster with ray.client. But when I run modin operations i get

```auto
...
~/.pyenv/versions/3.7.7/envs/env_ray/lib/python3.7/site-packages/ray/util/client/worker.py in _call_schedule_for_task(self, task)
    339 if not ticket.valid:
    340 try:
--> 341 raise cloudpickle.loads(ticket.error)
    342 except pickle.UnpicklingError:
    343 logger.exception("Failed to deserialize {}".format(

ModuleNotFoundError: No module named 'modin'

```

manually ssh-ing to the head and the workers and running “pip install modin[ray]” solves the issue but of course that is not a very good permanent solution. it just shows that the issue is indeed missing modin on the cluster.

What am i doing wrong? How do I do it right?  
Thanks for your help ! 🙂

---

<div class="post-metadata">

**Author:** ![Mofef](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mofef/32/1253_2.png) [@Mofef](https://discuss.ray.io/u/Mofef)\
**Post date:** [July 12, 2021, 4:09pm UTC](https://discuss.ray.io/t/install-modin-or-any-pip-package-on-ray-cluster/2783/2 "2021-07-12T16:09:22Z")

</div>

In case someone else has problems with this I’ll try to answer this myself:

TLDR: Don’t use helm for ray on kubernetes

I stil don’t know why this did not work, but i found that settingu up ray with helm is definitely not the easiest way.  
using ray.up with the ray on kubernetes default config from the ray repo works at least as easily. also setup\_commands do work then.  
Good luck!

---

<div class="post-metadata">

**Author:** ![Dmitri](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dmitri/32/657_2.png) [@Dmitri](https://discuss.ray.io/u/Dmitri)\
**Post date:** [July 15, 2021, 4:25am UTC](https://discuss.ray.io/t/install-modin-or-any-pip-package-on-ray-cluster/2783/3 "2021-07-15T04:25:45Z")

</div>

The solution is to either build the dependency into the image you’re using or try runtime environments: [Advanced Usage — Ray v1.4.1](https://docs.ray.io/en/master/advanced.html?highlight=runtime%20environments#runtime-environments-experimental)

---

<div class="post-metadata">

**Author:** ![Mofef](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mofef/32/1253_2.png) [@Mofef](https://discuss.ray.io/u/Mofef)\
**Post date:** [July 15, 2021, 11:46am UTC](https://discuss.ray.io/t/install-modin-or-any-pip-package-on-ray-cluster/2783/4 "2021-07-15T11:46:39Z")

</div>

Since I use ray up with a config for kubernetes instead of installing the cluster with helm setup\_commands also works as expected.  
But the option to dynamically define the runtime environment is a really nice additional option for flexible use!  
Thanks for the hint Dmitri! 🙂
