Answers for LLM inference engineers

ImportError: cannot import name 'X' from 'langchain.chains', 'langchain.schema', 'langchain.chat_models' ...: which version has it, and where it is now

LangChain 1.0.0 (2025-10-17) removed 39 of its top-level modules, among them langchain.chains, langchain.schema, langchain.memory, langchain.llms and langchain.vectorstores; 0.3.30 is the last release with them. 38 of them live on under the same path in the separate package langchain-classic: pip install langchain-classic, then from langchain_classic.chains import LLMChain. Messages, documents and prompts are in langchain_core. Model classes such as ChatOpenAI are in the provider packages (langchain_openai). Many names under langchain.* in 0.1 to 0.3 were never defined there: they were forwarded to langchain_community and worked only with it installed. For any name, paste the error below.

Published 2026-11-18 · Data as of 2026-11-18 · langchain 0.1.0 to 1.5.0 (every release, 130), langchain-classic 1.0.0 to 1.0.8, langchain-core 0.1.47 to 1.8.2 (first release of each minor, with patch releases that differ noted) · read from the source of each release tag, nothing was installed or run (how, limits) · Corrected 2026-12-05

Corrected on 2026-12-05: langchain-core was read only at the first release of each minor version, so a name added or removed in one of its patch releases was dated to the next minor. For example, from langchain_core.rate_limiters import InMemoryRateLimiter works from langchain-core 0.2.24 (2024-07-26), not only from 0.3.0. Every langchain-core release was then read once from PyPI: 8 top-level names and 2,363 module-and-name pairs in all differ in some patch release from the first release of the same minor. The lookup now gives those patch releases. langchain and langchain-classic were already read at every release.

Examples:

Runs in your browser on langchain.json (604 KB), langchain_classic.json (588 KB) and langchain_core.json (497 KB), loaded as needed; nothing you paste is sent anywhere. Covers 35,388 module-and-name pairs.

The imports people hit, and the import that works now

All of these work in langchain 0.1.0 to 0.3.30 and fail from 1.0.0.

Old importIn 0.1 to 0.3Now
from langchain.chains import LLMChaindefined in langchainfrom langchain_classic.chains import LLMChain (pip install langchain-classic)
from langchain.chains import RetrievalQAdefined in langchainfrom langchain_classic.chains import RetrievalQA (pip install langchain-classic)
from langchain.chains import ConversationalRetrievalChaindefined in langchainfrom langchain_classic.chains import ConversationalRetrievalChain (pip install langchain-classic)
from langchain.memory import ConversationBufferMemorydefined in langchainfrom langchain_classic.memory import ConversationBufferMemory (pip install langchain-classic)
from langchain.agents import AgentExecutordefined in langchainfrom langchain_classic.agents import AgentExecutor; new code: langchain.agents.create_agent
from langchain.agents import initialize_agentdefined in langchainfrom langchain_classic.agents import initialize_agent; new code: langchain.agents.create_agent
from langchain.text_splitter import RecursiveCharacterTextSplitterdefined in langchainfrom langchain_text_splitters import RecursiveCharacterTextSplitter (pip install langchain-text-splitters)
from langchain.schema import HumanMessagedefined in langchainfrom langchain_core.messages import HumanMessage, or from langchain.messages import HumanMessage (1.0.0 on)
from langchain.schema import Documentdefined in langchainfrom langchain_core.documents import Document
from langchain.prompts import PromptTemplatedefined in langchainfrom langchain_core.prompts import PromptTemplate
from langchain.chat_models import ChatOpenAIforwarded to langchain_community.chat_modelsfrom langchain_openai import ChatOpenAI
from langchain.vectorstores import FAISSforwarded to langchain_community.vectorstoresfrom langchain_community.vectorstores import FAISS (pip install langchain-community)
from langchain.document_loaders import PyPDFLoaderforwarded to langchain_community.document_loadersfrom langchain_community.document_loaders import PyPDFLoader (pip install langchain-community)
from langchain.embeddings import OpenAIEmbeddingsforwarded to langchain_community.embeddingsfrom langchain_openai import OpenAIEmbeddings

Which modules did LangChain 1.0 remove?

39 top-level modules; the right column is where the same module lives from 1.0.0. What stayed in langchain is small: agents (with create_agent), chat_models (init_chat_model), embeddings, messages, tools and a few more.

Removed in 1.0.0Same module now
langchain._apilangchain_classic._api
langchain.adapterslangchain_classic.adapters
langchain.base_languagelangchain_classic.base_language
langchain.cachelangchain_classic.cache
langchain.callbackslangchain_classic.callbacks
langchain.chainslangchain_classic.chains
langchain.chat_loaderslangchain_classic.chat_loaders
langchain.docstorelangchain_classic.docstore
langchain.document_loaderslangchain_classic.document_loaders
langchain.document_transformerslangchain_classic.document_transformers
langchain.envlangchain_classic.env
langchain.evaluationlangchain_classic.evaluation
langchain.example_generatorlangchain_classic.example_generator
langchain.formattinglangchain_classic.formatting
langchain.globalslangchain_classic.globals
langchain.graphslangchain_classic.graphs
langchain.hublangchain_classic.hub
langchain.indexeslangchain_classic.indexes
langchain.inputlangchain_classic.input
langchain.llmslangchain_classic.llms
langchain.loadlangchain_classic.load
langchain.memorylangchain_classic.memory
langchain.model_laboratorylangchain_classic.model_laboratory
langchain.output_parserslangchain_classic.output_parsers
langchain.promptslangchain_classic.prompts
langchain.pydantic_v1none: use pydantic directly
langchain.pythonlangchain_classic.python
langchain.requestslangchain_classic.requests
langchain.retrieverslangchain_classic.retrievers
langchain.runnableslangchain_classic.runnables
langchain.schemalangchain_classic.schema
langchain.serpapilangchain_classic.serpapi
langchain.smithlangchain_classic.smith
langchain.sql_databaselangchain_classic.sql_database
langchain.storagelangchain_classic.storage
langchain.text_splitterlangchain_classic.text_splitter
langchain.utilitieslangchain_classic.utilities
langchain.utilslangchain_classic.utils
langchain.vectorstoreslangchain_classic.vectorstores

Why did some imports work only with langchain-community installed?

In 0.1 to 0.3, modules such as langchain.chat_models, langchain.llms, langchain.vectorstores and langchain.document_loaders forwarded 1,243 names to langchain_community through a module-level __getattr__, with a deprecation warning. Without langchain-community the same line raised ImportError, on any version. langchain_classic keeps that forwarding. The lookup marks each forwarded name and gives the langchain_community module to import from directly.

How was this read, and how was it checked?

From the source of each release tag of the langchain monorepo, with Python's ast module; no release was installed or imported. langchain 0.x is read from libs/langchain, 1.x from libs/langchain_v1, langchain-classic from libs/langchain/langchain_classic, langchain-core from libs/core. A module's names are everything it binds at module level, plus the names its __getattr__ serves: the strings of __all__ and the keys of its lookup tables (DEPRECATED_LOOKUP, _dynamic_imports, create_importer(...)). Dates come from PyPI.

Checks, by a second reading: (1) each top-level name is found as plain text in __init__.py in every release of its range (8,586 name-and-release pairs). (2) A regular expression finds 29,928 definitions in 7,163 file versions; all are among the names read. (3) Regular expressions over every module that defines __getattr__ find 161,854 served names (summed over releases); all are among the names read. (4) 17 known facts hold, among them the reports under Sources.

Limits

Questions

How do I fix "cannot import name 'LLMChain' from 'langchain.chains'"?

LangChain 1.0.0 (2025-10-17) removed langchain.chains; 0.3.30 is the last release with it. Install the package that keeps the old code: pip install langchain-classic, then from langchain_classic.chains import LLMChain. Or pin pip install "langchain<1.0.0".

Where did langchain.schema, langchain.memory and langchain.agents.AgentExecutor go?

To langchain-classic: 38 of the 39 top-level modules that LangChain 1.0 removed exist under the same path in langchain_classic. Messages, documents and prompts are also in langchain_core (langchain_core.messages, langchain_core.documents, langchain_core.prompts). For agents, LangChain 1.0 has langchain.agents.create_agent.

Why did "from langchain.chat_models import ChatOpenAI" work in 0.3 but not in 1.0?

In 0.1 to 0.3, langchain.chat_models did not define ChatOpenAI; it forwarded the name to langchain_community.chat_models with a deprecation warning, and only when langchain-community was installed. 1.0 dropped the forwarding. Use from langchain_openai import ChatOpenAI.

I installed langchain-classic and "from langchain_classic.document_loaders import PyPDFLoader" still fails. Why?

langchain_classic forwards document loaders, vector stores and other integrations to langchain_community, like langchain 0.3 did. Install langchain-community, or import from langchain_community.document_loaders directly.

What did langchain-core 1.0 remove?

The modules langchain_core.beta, langchain_core.graph_vectorstores, langchain_core.memory, langchain_core.pydantic_v1. Memory classes live in langchain_classic.memory; for pydantic_v1, import from pydantic directly.

Sources

The same data as JSON: langchain.json, langchain_classic.json, langchain_core.json, licensed CC BY 4.0.

Related: "cannot import name ... from 'transformers'" · "... from 'huggingface_hub'" · "... from 'sentence_transformers'".