In Python stdlib v3.6, there is a module called secrets. Your line of script will try to look for IEX_CLOUD_API_TOKEN in there and definitely it won't find it.
Consider changing your file to something else like my_secrets.py
then the following command should work:
from my_secrets import IEX_CLOUD_API_TOKEN