Permission Denied With token_refresh.py
duncanmcdonald opened this issue · 1 comments
Here is my edited code:
`from sqlalchemy import create_engine
from td.client import TDClient
from datetime import datetime
from td import exceptions
import datetime
import pandas as pd
import sqlite3
import time
TDSession = TDClient(
client_id='P0HYTFEZR9BJXXXXXH5YXFMRG9NND72X',
redirect_uri='http://localhost',
credentials_path='C:/Users/xxxx/Documents'
)
TDSession.login()`
And I get:
`Traceback (most recent call last):
File "C:\Users\xxx\Documents\Trading\Options_Data_Science-main\token_refresh.py", line 13, in
credentials_path='C:/Users/dmcdo/Documents'
File "C:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\td\client.py", line 133, in init
self._state_manager('init')
File "C:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\td\client.py", line 218, in _state_manager
with open(file=self.credentials_path, mode='r') as json_file:
PermissionError: [Errno 13] Permission denied: 'C:\Users\xxx\Documents''
You may have solved this already but looks like you need to put the name of the json file at the end of your path, like C:/Users/xxxx/Documents/credentials.json