Options_Data_Science icon indicating copy to clipboard operation
Options_Data_Science copied to clipboard

Permission Denied With token_refresh.py

Open duncanmcdonald opened this issue 3 years ago • 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''

duncanmcdonald avatar Apr 23 '21 18:04 duncanmcdonald

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

symm3tri avatar Jun 24 '22 19:06 symm3tri