I am writing an application in Python that should be able to create and modify events in a Google Calendar according to the data in a Google Sheet.
As I have almost no experience with these APIs, I am following this simple guide on the Google documentation https://developers.google.com/google-apps/calendar/quickstart/python#. I enabled the Calendar API in the Developer Console of my project and installed the Google libraries as explained in Step 1 and Step 2. When I try to run the quickstart - which I simply copied from the guide - the script correctly opens up a window in my browser (Google Chrome) asking to give permission to my application to access the calendars. When I click on "Accept", however, I get an error page saying that "localhost didn’t send any data. ERR_EMPTY_RESPONSE". No credentials are stored in the ~/.credentials folder, as it should happen according to the script. Moreover, the execution of the script hangs at the point of authentication. Where could the problem be?