I get an error trying to run the bot.py
ferx2006 opened this issue · comments
Traceback (most recent call last):
File "/home/bp/Downloads/Telegram-Airdrop-Bot-main/bot.py", line 26, in
COIN_SYMBOL = os.environ["COIN_SYMBOL"]
File "/usr/lib/python3.9/os.py", line 679, in getitem
raise KeyError(key) from None
KeyError: 'COIN_SYMBOL'
Have you set your environment variables?
Yes, I set .env file
Hello, have you found a solution for this error?
check in docker-compose.yml file if the .env file is set with correct credentials, this error is due to incorrect environment variables.
Traceback (most recent call last):
File "/home/bp/Downloads/Telegram-Airdrop-Bot-main/bot.py", line 26, in
COIN_SYMBOL = os.environ["COIN_SYMBOL"]
File "/usr/lib/python3.9/os.py", line 679, in getitem
raise KeyError(key) from None
KeyError: 'COIN_SYMBOL'
Install python-dotenv package using pip install python-dotenv
then import it in the env.py file using from dotenv import load_dotenv
then call the load_dotenv() function immediately after importing it just about the next line.