Open xiaolongluo1979 opened 8 months ago
Have you obtained a Time GPT token and set it as a environment variable? You can get a token here - https://dashboard.nixtla.io/
You should create an .env file in the project directory and paste the API key into it. As seen here:
Then install python dotenv.
pip install python-dotenv
And use this lines in your example file to load environment:
from dotenv import load_dotenv
load_dotenv()
This may be a naive question as I am not a developer ...
After installing nixtlats (via !pip install nixtlats on jupyter notebook), I was trying the simple codes provided but got the following error:
KeyError Traceback (most recent call last) /tmp/ipykernel_6602/2071313601.py in
2
3 from nixtlats import TimeGPT
----> 4 timegpt = TimeGPT(token=os.environ['TIMEGPT_TOKEN'])
5 fcst_df = timegpt.forecast(df, h=24, level=[80, 90])
~/anaconda3/lib/python3.9/os.py in getitem(self, key) 677 except KeyError: 678 # raise KeyError with the original key value --> 679 raise KeyError(key) from None 680 return self.decodevalue(value) 681
KeyError: 'TIMEGPT_TOKEN'
How do I get the 'TIMEGPT_TOKEN' ?