OpenBB
OpenBB copied to clipboard
[Bug] OpenBB SDK compains about not having API_FRED_KEY even though it exists
Describe the bug
I'm attempting to run the openbb.economy.fred method in a Jupyter Notebook using the OpenBB SDK.
When I do, I receive a warning: API_FRED_KEY not defined. Set API Keys in ~/.openbb_terminal/.env or under keys menu.
I set my FRED API keys in ~/.openbb_terminal/.env like this:
API_FRED_KEY='my_fred_api_key'
When I re-run the openbb.economy.fred method in a Jupyter Notebook using the OpenBB SDK, I get the same warning.
To Reproduce See above
Screenshots


Desktop (please complete the following information):
- OS: Mac
- Python version: 3.19.13
Additional context
- After adding the API key to the
.envfile, I shut down the terminal window and Jupyter Notebook instance before trying again. - I tried adding the API both with and without quotes.
- I tried running the same code from a Python interactive session.
Will investigate. An alternative with the sdk would be:
openbb.keys.fred(
key = 'replace_me',
persist = True,
)
Which will replace in the correct env file
This worked.
Hey @jasonstrimpel
Anychance that the original issue has been resolved with the update?
Looks like it's fixed now:

Disclaimer: this might not behave exactly this way after #4015 is merged.