# Dask Kubernetes Setup Issue

**URL:** <https://discourse.pangeo.io/t/dask-kubernetes-setup-issue/3730>\
**Category:** Cloud\
**Created:** [October 4, 2023, 2:20pm UTC](https://discourse.pangeo.io/t/dask-kubernetes-setup-issue/3730 "2023-10-04T14:20:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lei](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/lei/32/1390_2.png) [@lei](https://discourse.pangeo.io/u/lei)\
**Post date:** [October 4, 2023, 2:20pm UTC](https://discourse.pangeo.io/t/dask-kubernetes-setup-issue/3730/1 "2023-10-04T14:20:52Z")

</div>

#Cloud Dask Kubernetes Setup Issue

Hello everyone!

I’ve been a user of Pangeo Cloud and its distributed computing capabilities through Dask. The last time I used it (about a year ago), everything was working perfectly. However, I recently tried setting up a Dask cluster using `dask_kubernetes`, and I’ve encountered an issue.

## The Code

Here’s the snippet of code I’ve been using:

```python
from dask.distributed import Client, progress
from dask_kubernetes import KubeCluster

cluster = KubeCluster()
cluster.adapt(minimum=1, maximum=20)

client = Client(cluster)
print(client)

```

## The Problem

When I run the above code, I get the following error:

```auto
ModuleNotFoundError: No module named 'dask_kubernetes'

```

Given that this setup worked in the past, I’m wondering:

- Has there been any significant changes to the Pangeo Cloud in the last year that might affect this?
- Is it possible that dask\_kubernetes has been deprecated or replaced with another module within the Pangeo Cloud environment?

---

<div class="post-metadata">

**Author:** ![scottyhq](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/scottyhq/32/162_2.png) [@scottyhq](https://discourse.pangeo.io/u/scottyhq)\
**Post date:** [October 4, 2023, 7:53pm UTC](https://discourse.pangeo.io/t/dask-kubernetes-setup-issue/3730/2 "2023-10-04T19:53:38Z")

</div>

Hello @lei I’m surprised that code worked a year ago, as the Pangeo JupyterHubs switched from using dask\_kubernetes to dask-gateway many years ago. In any case, you should be able to setup your cluster as documented here and still run your code [Pangeo Cloud — Pangeo documentation](https://pangeo.io/cloud.html#dask)

```python
from dask_gateway import GatewayCluster

cluster = GatewayCluster()
cluster.adapt(minimum=2, maximum=10) # or cluster.scale(n) to a fixed size.
client = cluster.get_client()

```

---

<div class="post-metadata">

**Author:** ![lei](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/lei/32/1390_2.png) [@lei](https://discourse.pangeo.io/u/lei)\
**Post date:** [October 5, 2023, 12:34am UTC](https://discourse.pangeo.io/t/dask-kubernetes-setup-issue/3730/3 "2023-10-05T00:34:23Z")

</div>

Apologies, I have not used Pangeo in a while so I was mistaken. Thank you for correcting me on the proper way to initialize a Dask cluster on Pangeo Cloud.
