Can't install dotenv for python discord bot

So basically, I made a discord bot and stored the token in my .env file. To get the file I use import os and from dotenv import load_dotenv. Although, when I put my project on glitch, it can’t install the module.

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

My code is:
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
client = discord.Client()
client.run(TOKEN)

Does anyone have a solution to this? Or is there an alternative to dotenv?

Glitch doesn’t support python… check the docs on what you can and cannot run

And what is the full Command output??

Eyy so I did more digging and apparently I needed to use pip3 install python-dotenv instead of pip3 install dotenv. It works now. Thanks

Just a correction, Glitch can run python, but it is not officially supported.

And @zehayk glad you got it working!

1 Like

Oh well as long as I find the modules I need and it can run python, this works for me. Thanks for correction :smiley:

1 Like

Since when? I tried at the beginning of the year end of last and wasn’t successful

See the last post, it is possible.