Using .env file for API keys

Question:

Need Help for .env files

So I’m incredibly new to coding, followed a guide to create a bot step by step, but whenever I run it it says

“Using .env file for API keys
Authentication OK”

And that’s all. Nothing else. From what I can tell .env files shouldn’t be a thing, and my API keys and other secrets are in the dedicated Secrets tool menu. What am I doing wrong, and can I fix this?

1 Like

.env files don’t exist in Replit. Use the Secrets tab instead.

4 Likes

Did you read what I said? I used the secrets tool, all of my secrets are in there. But when running the code it mentions .env files for some reason.

In no way have I used .env files, just the Secrets tab.

Hmm… In that case, I think that that bot might not be compatible with Replit.

Could you provide the link to your Repl and a screenshot of the output?

might I suggest starting with https://replit.com/learn/100-days-of-python? It’ll probably be more useful and less frustrating to start with more simple projects as that tutorial does.


in your code (in future, please link this in your initial post), remove this line. The code isn’t using a .env file at all. (.env files on replit used to have an identical function to Secrets)

print("Using .env file for API keys")
3 Likes