Ask coding questions

← Back to all posts
Why os.getenv is None?
TejasvMaheshwar (7)

So i was following along a tutorial to make a discord bot in repl.... and whenver i print os.getenv the result is none.... whats the issue?
my env file name is *.env

Answered by 19ecal (228) [earned 5 cycles]
View Answer
Comments
hotnewtop
19ecal (228)

Your env file's name should be .env Nothing more, nothing less

TejasvMaheshwar (7)

it gives an error that the file name cant be just be .env
@19ecal

TejasvMaheshwar (7)

it still gives the output as none ://
@19ecal

TejasvMaheshwar (7)

ahh i deleted the prev file and made a new one it works just fine now
..... thanks a lot
@19ecal