| 1 |
# flake8: noqa |
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
_import_error_message = ( |
| 6 |
"dask.distributed is not installed.\n\n" |
| 7 |
"Please either conda or pip install distributed:\n\n" |
| 8 |
" conda install dask distributed # either conda install\n" |
| 9 |
' python -m pip install "dask[distributed]" --upgrade # or pip install' |
| 10 |
) |
| 11 |
|
| 12 |
try: |
| 13 |
from distributed import * |
| 14 |
except ImportError as e: |
| 15 |
if e.msg == "No module named 'distributed'": |
| 16 |
raise ImportError(_import_error_message) from e |
| 17 |
else: |
| 18 |
raise |
| 19 |
|
| 20 |
|
| 21 |
def __getattr__(value): |
| 22 |
try: |
| 23 |
import distributed |
| 24 |
except ImportError as e: |
| 25 |
raise ImportError(_import_error_message) from e |
| 26 |
return getattr(distributed, value) |