nickmccullum / algorithmic-trading-python

The repository for freeCodeCamp's YouTube course, Algorithmic Trading in Python
2.45k stars 2.44k forks source link

downloading secrets.py #7

Open noaa1603 opened 3 years ago

noaa1603 commented 3 years ago

When I click on download the file, a new tab opens with only one line written in it: IEX_CLOUD_API_TOKEN = 'Tpk_059b97af715d417d9f49f50b51b1c448' What should I do?

Deang1983 commented 3 years ago

I'm getting the same thing when trying to download the secrets.py file...

sjk39 commented 3 years ago

Hey, to solve this you can just copy that text into notepad or another text editor and just save as secrets.py

yogesh3singh commented 3 years ago

Hey, to solve this you can just copy that text into python idle and just save as secrets.py

Christianp54 commented 3 years ago

Also, if you're on windows make sure to select "all files" on the drop down or it will just save a a secrets.py.txt....not a secrets.py

AGAMFIRE commented 3 years ago

Thank You So Much

Dereklenny commented 3 years ago

I saved it to secrets.py however it still is not working . image

shekinahgc commented 3 years ago

I'm using mac. Same thing happened to me, a new tab opened and saved it to a text editor file with extension of .py and tried it again. still didnt work so I can't continue the course. Send help

erickjvazquez commented 3 years ago

I'm using mac. Same thing happened to me, a new tab opened and saved it to a text editor file with extension of .py and tried it again. still didnt work so I can't continue the course. Send help

Hey guys and gals, I had the same issue, seems to be that "secrets" it's now a built in module in python, so you need to rename it to something else. And then it should work (Rename the secrets. pays to something else.py).

Cheers!

Addendum: You also need to create a free account on https://iexcloud.io/ and setup the environment to sandbox in order to get your API test key and then finally you can proceed with the tutorial.

DrewN8 commented 3 years ago

I'm using mac. Same thing happened to me, a new tab opened and saved it to a text editor file with extension of .py and tried it again. still didnt work so I can't continue the course. Send help

Hey guys and gals, I had the same issue, seems to be that "secrets" it's now a built in module in python, so you need to rename it to something else. And then it should work (Rename the secrets. pays to something else.py).

Cheers!

Addendum: You also need to create a free account on https://iexcloud.io/ and setup the environment to sandbox in order to get your API test key and then finally you can proceed with the tutorial.

Had the same issue on MAC so I named a textedit file "secretstest.py" and when I tried to import it got a module not found error. I also set up my iexcloud account and set it to sandbox mode. Any idea what's going on? I'm very inexperienced and genuinely don't know what's going wrong here, sorry if I did something stupid.

DrewN8 commented 3 years ago

I'm using mac. Same thing happened to me, a new tab opened and saved it to a text editor file with extension of .py and tried it again. still didnt work so I can't continue the course. Send help

Hey guys and gals, I had the same issue, seems to be that "secrets" it's now a built in module in python, so you need to rename it to something else. And then it should work (Rename the secrets. pays to something else.py). Cheers! Addendum: You also need to create a free account on https://iexcloud.io/ and setup the environment to sandbox in order to get your API test key and then finally you can proceed with the tutorial.

Had the same issue on MAC so I named a textedit file "secretstest.py" and when I tried to import it got a module not found error. I also set up my iexcloud account and set it to sandbox mode. Any idea what's going on? I'm very inexperienced and genuinely don't know what's going wrong here, sorry if I did something stupid.

to clarify, it was not the importerror message nick got in the tutorial (ModuleNotFoundError: No module named 'secretstest')

Aman762000 commented 3 years ago

Hi Guys, I'm also facing the same issue, I've tried reloading the Kernal and also saved the file multiple times with different names with all folders selected, and seeing the error same as this pic above. Please Help

Taka1313 commented 2 years ago
Screen Shot 2021-11-26 at 02 15 56

I'm using Mac too. And changed the file name secret to another file name. But, I got this error saying "null is not defined" When I changed "null" to "1", it says like the below.

Screen Shot 2021-11-26 at 02 20 03
ThomazPires commented 2 years ago

Hey, to solve this you can just copy that text into notepad or another text editor and just save as secrets.py

how do you save as secrets.py? where do you save it?

ibuchix commented 2 years ago

I am following this tutorial on Youtube and there isn't any link to download the secrets.py file that was mentioned in the video. I understand that secrets.py is for storing API keys from IEX, but the video does not show how to go about getting those keys. The concept is understandable, go on IEX, create a sandbox, get your API keys and save them in a secrets.py file. However, to follow a YouTube tutorial, the concept wouldn't work because you may end up with the wrong outcome. Please HELP

whightspace commented 2 years ago

When I click on download the file, a new tab opens with only one line written in it: IEX_CLOUD_API_TOKEN = 'Tpk_059b97af715d417d9f49f50b51b1c448' What should I do?

What you need to do is copy the entire line i.e. " IEX_CLOUD_API_TOKEN = 'Tpk_059b97af715d417d9f49f50b51b1c448' " Open notepad -> paste it and save it as " sec.py " (Note that .py is a python extension. Don't save it as sec.py.txt)

Then change this line from secrets import IEX_CLOUD_API_TOKEN to from sec import IEX_CLOUD_API_TOKEN

Note that we can't use the secrets name because it already exists in python as something else.

AbhishekG-1plus commented 2 years ago

When I click on download the file, a new tab opens with only one line written in it: IEX_CLOUD_API_TOKEN = 'Tpk_059b97af715d417d9f49f50b51b1c448' What should I do?

What you need to do is copy the entire line i.e. " IEX_CLOUD_API_TOKEN = 'Tpk_059b97af715d417d9f49f50b51b1c448' " Open notepad -> paste it and save it as " sec.py " (Note that .py is a python extension. Don't save it as sec.py.txt)

Then change this line from secrets import IEX_CLOUD_API_TOKEN to from sec import IEX_CLOUD_API_TOKEN

Note that we can't use the secrets name because it already exists in python as something else.

this worked like a charm, thank you!