'ImportError: cannot import name 'IEX_CLOUD_API_TOKEN' from 'secrets'

I'm facing the above error when I try to execute the following code:

from secrets import IEX_CLOUD_API_TOKEN

I tried using '.secrets' instead of 'secrets' but that gives the ModuleNotFoundError.



Solution 1:[1]

It's not a problem with the secrets library or anything of such kind.

It's just that after uploading secrets.py to the working directory, restart the kernel in your jupyter notebook.

Code shall run !!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user878622