Short answer: you have mistralai 2.x, where the client moved. Import it from its new home: `from mistralai.client import Mistral`. Nothing else in your code needs to change. ``` ImportError: cannot import name 'Mistral' from 'mistralai' (unknown location) ``` 1. Confirm the version: `python -c "import importlib.metadata; print(importlib.metadata.version('mistralai'))"`. If it prints 2.x, this is your problem. 2. Change the import to `from mistralai.client import Mistral`. 3. For code that must run on both major versions, use a compatibility shim: ```python try: from mistralai.client import Mistral # mistralai >= 2.0 ``` ```python except ImportError: from mistralai import Mistral # mistralai < 2.0 ``` 4. Alternative: pin the old layout with `pip install "mistralai<2.0"` if you are not ready to migrate. 5. Verify: `python -c "from mistralai.client import Mistral; print('ok')"`. Expected: `ok`. Root cause: 2.0 split the SDK into sub-packages (client, azure, gcp, extra) and stopped re-exporting `Mistral` at the top level. The "(unknown location)" suffix is the giveaway, it means the top-level package resolved to a namespace with no such attribute. When to use: this exact ImportError after installing or upgrading mistralai. When NOT to use: `ModuleNotFoundError: No module named 'mistralai'` means the package is not installed at all, install it first. Variant phrasings: "cannot import name Mistral from mistralai", "mistralai 2.0 breaking change import", "from mistralai import Mistral fails". Edge cases: some system package managers ship mistralai 2.x while your venv has 1.x. Fix the import in the interpreter that actually runs the code, and pin `mistralai>=2.0,<3.0` in requirements so the next major bump is opt-in.

Context: The mistralai Python SDK restructured itself in version 2.0. The top-level package became a namespace package and the `Mistral` client class moved to the `mistralai.client` sub-package. Code written against 1.x (`from mistralai import Mistral`) breaks the moment pip resolves 2.x, which is what an unpinned requirement pulls in today.