Thuta Learning
BasicAIadvanced

Setup & API Keys

Relax. We'll talk through this in plain words — no textbook voice.

To get started with LangChain (Python), you'll need Python installed on your computer along with the required packages.

Most importantly, you'll need an API Key from an LLM provider (e.g., OpenAI).

Setup steps:

1. In your terminal, run pip install langchain openai to install the packages.

2. Register on the OpenAI website and grab your API key.

3. Set the API key as an environment variable. (In your terminal: export OPENAI_API_KEY="...")

python
# Install required packages
pip install langchain langchain-openai

# Set your OpenAI API key as an environment variable
# It's best practice not to write the key directly in the code.
# export OPENAI_API_KEY="your_api_key_here"
You should see
(In Google Colab, you can install with !pip install ... and plug in your key directly to try it out.)