-
-
Notifications
You must be signed in to change notification settings - Fork 943
Description
Description
Importing PromptTemplate from langchain.prompts fails with a module resolution error in recent versions of LangChain.
Steps to reproduce
- Install langchain 1.2.10
- Run the following code:
from langchain.prompts import PromptTemplate
Expected behavior
PromptTemplate is importable from langchain.prompts as documented in most existing tutorials and examples.
Actual behavior
Module not found / cannot be resolved error.
Workaround
Use the following import instead:
from langchain_core.prompts import PromptTemplate
Environment
- langchain: 1.2.10
- langchain-core: 1.2.15
- Python: 3.13
- OS: Windows 11
Notes
Most tutorials and official examples still reference langchain.prompts, which leads to confusion for new users.
Either the old import path should be maintained for backwards compatibility, or the documentation and examples should be updated to reflect the new structure.