Closed prashant182 closed 7 years ago
I also faced this error, as a workaround i created a blank environment variable.
On my PR #55 I already fixed this bug by using os.environ.get('KG_ENV_WHITELIST', '')
instead of os.environ['KG_ENV_WHITELIST']
.
Closing this issue as it was fixed by PR #55. Thanks @liukun1016!
Traceback (most recent call last):
File "app.py", line 9, in
anyone help me to resolve this issue
Traceback (most recent call last):
File "app.py", line 9, in
Hi @aafaq146 - your issue description doesn't appear to be related to Kernel Gateway. Where are you encountering this issue? If anything, this appears related to the TwitterClient package and you'll get more traction opening an issue with whomever produced TwitterClient.
Your immediate issue is that you're trying to fetch an environment variable that is not in the current environment. I would recommend using getenv
instead, then check for a None
result to determine if the variable does not exist - or add exception handling...
Using os.getenv()
...
consumer_key = os.getenv('JQM5TMwSPV6fKHmfbSBNKgE2O')
if consumer_key is None:
# Perform what should happen when variable does not exist
...
or with exception handling...
try:
consumer_key = os.environ['JQM5TMwSPV6fKHmfbSBNKgE2O']
except KeyError:
# Key does not exist
pass
if consumer_key is None:
# Perform what should happen when variable does not exist
...
issue