Skip to content

docs: explain how to load the .env file in Python get-started#3218

Open
virginiamwega2-svg wants to merge 1 commit into
langfuse:mainfrom
virginiamwega2-svg:docs/env-python-load-dotenv
Open

docs: explain how to load the .env file in Python get-started#3218
virginiamwega2-svg wants to merge 1 commit into
langfuse:mainfrom
virginiamwega2-svg:docs/env-python-load-dotenv

Conversation

@virginiamwega2-svg

@virginiamwega2-svg virginiamwega2-svg commented Jul 1, 2026

Copy link
Copy Markdown

Problem

The Python get-started env block shows a .env file with the Langfuse credentials, but nothing on the page explains that Python doesn't load .env automatically. A first-time user who follows the guide verbatim (python script.py) hits missing-credential errors on their very first run, because the variables were never actually loaded into the environment.

Fix

Add a short <Callout> right after the .env block that points to python-dotenv (load_dotenv()), with a shell export alternative for anyone who prefers that.

This edit is in the shared components-mdx/env-python.mdx component, which is imported by the OpenAI SDK, Python SDK, and LangChain (Python) get-started tabs (plus the OpenAI-py integration page), so the note shows up everywhere the .env block appears — one small change, consistent everywhere.

Notes

  • No existing lines changed; the diff is purely additive (one Callout block).
  • <Callout> is already used elsewhere in components-mdx (e.g. github-cta.mdx), so no new import is needed.
  • Found while following the get-started guide end-to-end as a new user.

Greptile Summary

This PR adds guidance for loading Python .env files in the shared docs snippet. The main changes are:

  • Adds an info callout after the Python environment block.
  • Shows python-dotenv installation and load_dotenv() usage.
  • Mentions shell export as an alternative.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (1): Last reviewed commit: "docs: explain how to load the .env file ..." | Re-trigger Greptile

The Python get-started env block shows a `.env` file but never explains
that Python does not load it automatically. First-time users who follow
the guide verbatim hit missing-credential errors on their first run.

Add a short Callout after the `.env` block pointing to python-dotenv
(`load_dotenv()`) with a shell `export` alternative. This shared
component is imported by the OpenAI SDK, Python SDK, and LangChain
get-started pages, so the note appears everywhere the block is shown.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

@virginiamwega2-svg is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 1, 2026
@CLAassistant

CLAassistant commented Jul 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot Bot added the documentation Improvements or additions to documentation label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants