So I am currently making a slack bot using python. I am not extremely familiar with python but still know some stuff. For some reason I keep getting this error. I've tried multiple things and can't seem to figure it out. Here's the code.
client = slack.WebClient(token=os.environ['SLACK_TOKEN'])
File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 679, in getitem
raise KeyError(key) from None
KeyError: 'SLACK_TOKEN'
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
Missing env SLACK_TOKEN, that should be set as your environment variable.
There is no such key like SLACK_TOKEN.
KeyError is pretty self explanatory.
Thank you!!