replicate-python icon indicating copy to clipboard operation
replicate-python copied to clipboard

REPLICATE_API_TOKEN not picked up in .env file

Open Ivan-developer0 opened this issue 7 months ago • 1 comments

Hi team 👋 I’ve 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!

Ivan-developer0 avatar May 15 '25 15:05 Ivan-developer0

Hello,

Have you tried ?

`from dotenv import load_dotenv import os

load_dotenv()

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

tg-hubvisory avatar Jul 31 '25 11:07 tg-hubvisory