slgobinath / gcalendar

Read-only Google Calendar utility for Linux
GNU General Public License v3.0
47 stars 4 forks source link

after authorizing gcalendar with google I still get ''Failed to connect Google calendar'' #6

Closed gabrielebianchi closed 3 years ago

gabrielebianchi commented 3 years ago

I have been using the Google Calendar deskjet in Cinnamon without any problem for a long time. It has stopped working a few months ago. This morning I am trying to make it work again. issuing the command gcalendar gives me the answer ''Failed to connect Google calendar'' I have tried issuing gcalendar --reset and then going through the authorization procedure again. This procedure completes but when I issue the command gcalendar again I still get ''Failed to connect Google calendar''

looking to other old posts with similar problem I have run git clone https://github.com/slgobinath/gcalendar.git cd gcalendar python3 -m gcalendar --debug

The output is the following

Failed to connect Google Calendar Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/gabriele/gcalendar/gcalendar/main.py", line 219, in main() File "/home/gabriele/gcalendar/gcalendar/main.py", line 213, in main handle_error(ex, "Failed to connect Google Calendar", args.output, args.debug) File "/home/gabriele/gcalendar/gcalendar/main.py", line 86, in handle_error raise error File "/home/gabriele/gcalendar/gcalendar/main.py", line 187, in main calendar_events = g_calendar.list_events(selected_calendars, start_time, end_time, time_zone) File "/home/gabriele/gcalendar/gcalendar/gcalendar.py", line 90, in list_events start_time, end_time, time_zone) File "/home/gabriele/gcalendar/gcalendar/gcalendar.py", line 113, in retrieve_events start_date_time = parser.isoparse(event["start"]["dateTime"]).astimezone(time_zone) AttributeError: module 'dateutil.parser' has no attribute 'isoparse'

Thanks for any help. Gabriele

slgobinath commented 3 years ago

Hi, How did you install gcalendar? Can you run the following command and see if it helps?

pip3 install -U python-dateutil
gabrielebianchi commented 3 years ago

Your suggestion solved the problem. Now gcalendar runs fine. I do not know what has happened. I have installed gcalendar probably in 2019, via the deb package available on your repository for linux Mint.

Thanks for your help and thanks for gcalendar, Gabriele

slgobinath commented 3 years ago

The older version of dateutil does not have the isoparse. If an older version of python-dateutil was already installed on your system, it may not be upgraded to the latest version. Above command upgrades the package to the latest version.

FYI: You can use gcalendar --debug from your terminal. No need to clone the source code as I included that change in the last release.

Thank you for using gcalendar and hope you find it useful. Have a great day.