I'm working on Power BI and i have discoverd Python recently.
For training purpose i try to use a html data and plug in the data on Google Sheets
After that i will use this data on Power BI
I have found some greats tutorial but i'm stuck.
So i follow this tutorial https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html . But when i try to connect my json identifier Pycharm (my IDE) tell me the project doesn't find this json file.
I have tried 10 parameters. I think i miss something but don't know what ! I have generated the right json file. i know that for sure.
It's "just" the connection issue
start the connection with gs in py
import requests
from bs4 import BeautifulSoup
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('parameters.json', scope)
client = gspread.authorize(creds)
The json file is on the same folder that py code. This is my error message :
Traceback (most recent call last):
File "C:/Users/MONNETA/PycharmProjects/untitled/premierscrapweb.py", line 24, in <module>
creds = ServiceAccountCredentials.from_json_keyfile_name('parameters.json', scope)
File "C:\Users\MONNETA\PycharmProjects\untitled\venv\lib\site-packages\oauth2client\service_account.py", line 219, in from_json_keyfile_name
with open(filename, 'r') as file_obj:
FileNotFoundError: [Errno 2] No such file or directory: 'parameters.json'
I hope you can help me on this :)