jeremyephron / simplegmail

A simple Gmail API client for applications in Python
MIT License
339 stars 73 forks source link

Python version issue, perhaps? #13

Closed rodolfo-viana closed 4 years ago

rodolfo-viana commented 4 years ago

I have run a script using simplegmailwith Python 3.8 and it works fine. But when I upload it to a VM on a cloud (with Python 3.6.9 along with credentials.json and gmail-token.json), I get this error:

Traceback (most recent call last):
  File "script.py", line 7, in <module>
    from simplegmail import Gmail
  File "/usr/local/lib/python3.6/dist-packages/simplegmail/__init__.py", line 1, in <module>
    from simplegmail.gmail import Gmail
  File "/usr/local/lib/python3.6/dist-packages/simplegmail/gmail.py", line 27, in <module>
    from simplegmail import labels
  File "/usr/local/lib/python3.6/dist-packages/simplegmail/labels.py", line 3, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

I believe it is related to one of the dependencies for simplegmail itself does not have a module named dataclasses.

jeremyephron commented 4 years ago

dataclasses is a module added to Python 3.7. This was my mistake, as I have the required Python version listed as Python 3.6. For now, if you can use Python >= 3.7 that would work, but I will try refactor to use Python 3.6 compatible code.

jeremyephron commented 4 years ago

@rodolfo-viana Version 3.0.0 just released fixed the compatibility issues. It is now fully Python >= 3.6 compatible. It does break with v2.x.x, and you'll have to reauthenticate any projects the first time you create a Gmail object after upgrading.

rodolfo-viana commented 4 years ago

That's awesome. Thank you.