Skip to content

Commit

Permalink
Add a clearer error message on when trying to use client with missing…
Browse files Browse the repository at this point in the history
… deps (#1200)
  • Loading branch information
ml-evs committed May 29, 2022
1 parent 6c2e768 commit 05a0574
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions optimade/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@
import json
import functools

import httpx
from pydantic import AnyUrl
from rich.progress import TaskID
from rich.panel import Panel

# External deps that are only used in the client code
try:
import httpx
from rich.progress import TaskID
from rich.panel import Panel
except ImportError as exc:
raise ImportError(
"Could not find dependencies required for the `OptimadeClient`. "
"Please install them with `pip install .[http_client]` (if using a local repository) "
"or `pip install optimade[http_client]` (if using the PyPI package)."
) from exc


from optimade.utils import get_all_databases
from optimade.filterparser import LarkParser
Expand Down

0 comments on commit 05a0574

Please sign in to comment.