Configure a Python Environment

# Initialize Conda Environment
conda create -n langchain
conda activate langchain

# Install LangChain dependencies
conda install langchain -c conda-forge
$Env:LANGCHAIN_TRACING_V2 = "true"
$Env:LANGCHAIN_API_KEY="<key>"

# Install OpenAI Dependencies
pip install python-dotenv
pip install langchain-openai
$Env:OPENAI_API_KEY="<key>"

Reference

LangChain ChatOpenAI Reference