## TL;DR

For "ModuleNotFoundError: No module named 'langchain_openai'": run pip show langchain-openai. LangChain splits every provider into its own package. pip install langchain never includes them. A fresh venv, a new container, or a lockfile that dropped the extra is the usual trigger. `` pip install -U langchain-openai ` 3. uv-managed project? Use uv add langchain-openai.

```text
ModuleNotFoundError: No module named 'langchain_openai'
```

## When to use

You are seeing this: If it prints nothing, the package is genuinely absent. Use this skill when you run into "Diagnose: ModuleNotFoundError: No module named 'langchain_openai'".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Steps

1. Run `pip show langchain-openai`. If it prints nothing, the package is genuinely absent. Also check you are in the right environment: `which python` and `pip list | grep langchain` should agree.

2. LangChain splits every provider into its own package. `pip install langchain` never includes them. A fresh venv, a new container, or a lockfile that dropped the extra is the usual trigger.

```
pip install -U langchain-openai
```

3. uv-managed project? Use `uv add langchain-openai`. Do not mix pip and uv.

```python
from langchain_openai import ChatOpenAI
print("ok")
```

4. If the import works, done. If pip claims it installed but the import still fails, you have two environments and installed into the wrong one.

## Why this happens

LangChain splits every provider into its own package. pip install langchain never includes them.

## Edge cases

- Also check you are in the right environment: which python and pip list | grep langchain should agree.
