Sitelet https://github.com/replicate/replicate-python/issues/433
Skip to content

REPLICATE_API_TOKEN not picked up in .env file聽#433

Description

@Ivan-developer0

Hi team 馃憢
I鈥檝e set REPLICATE_API_TOKEN in my .env file but replicate still throws:

Environment variable REPLICATE_API_TOKEN is required

Using python-dotenv and other env variables load fine.
Does this lib auto-load .env or should I do it manually?

Thanks!

Activity

  1. tg-hubvisory commented on Jul 31, 2025

    @tg-hubvisory

    Hello,

    Have you tried ?

    `from dotenv import load_dotenv
    import os

    load_dotenv()

    my_secret = os.getenv("MY_SECRET_KEY")
    print(my_secret)
    `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions