0

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 :)

Community
  • 1
  • 1
  • The error is clear - there is no `parameters.json` where it expects it to find it. Where is your json file located? Check the file name for misspellings. try to specify full path to file. – buran Sep 11 '19 at 06:45
  • It's on the same folder than the py code. I have allready try to specify the full path i will try again thanks – Antonin Monnet Sep 11 '19 at 08:23
  • check https://stackoverflow.com/a/34304165/4046632 and the link provided in the answer – buran Sep 11 '19 at 08:26
  • Hello @buran thanks for you help i will check – Antonin Monnet Sep 18 '19 at 07:48

0 Answers0