匠人学院 JR Academy
Skip to article
Learning guide
LangChain Guide

Build LLM apps with LangChain using chains, agents, memory, RAG, and orchestration patterns.

3 chapters·9 guides·Access varies by chapter
Installation
On this page

Installing LangChain and Its Integrations

LangChain separates its core interfaces from provider integrations. Installing langchain alone does not install every model adapter or document loader.

#Create an isolated environment

bash
python -m venv .venv source .venv/bin/activate python -m pip install langchain langchain-openai python-dotenv python -m pip check

On Windows PowerShell, activate with .venv\Scripts\Activate.ps1. Use a Python version supported by the package release you install.

PackagePurpose
langchain-coreMessages, prompts, runnable interfaces
langchain-openaiOpenAI integration
langchain-anthropicAnthropic integration
langchain-google-genaiGemini integration
langchain-communityAdditional community integrations
langchain-chromaChroma vector-store integration
langgraphStateful graph workflows
langsmithTracing and evaluation integration

Install only the integrations you use. A missing langchain_openai import usually means the provider package is absent from the active environment, not that the core package is broken.

#Separate installation from provider access

Check imports without making a model request:

bash
python -c "from langchain_core.prompts import ChatPromptTemplate; print('Core import OK')"

Configure OPENAI_API_KEY and a supported OPENAI_MODEL only when provider execution is authorized. Keep secrets out of Git. Load environment configuration before creating a client; it does not need to precede every Python import.

#Lock a working environment

After resolving compatible versions, save an exact lockfile or a reviewed pip freeze output. Do not combine old 0.x tutorial imports with a current major version without checking migration notes. Validate dependency compatibility before upgrading shared packages such as Pydantic.

Tracing is optional and can transmit prompts and outputs. Configure redaction, consent and retention before enabling it for private data; do not assume a hosted service is automatically free or suitable for every workload.

Installation documentation↗ · Quick start

Published by
JR Academy
Learning resources

Individual authors and reviewers are credited where recorded.

System Design

Core system design concepts and practical case studies

Learn the trade-offs and patterns that matter in technical interviews.

Open System Design →

Related Roadmaps

Done reading? Next steps