GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.65k stars 211 forks source link

Syntax error #58

Closed nischg closed 8 years ago

nischg commented 9 years ago

Probably a newbie error, but when I try to run the tool I get the following back:

Traceback (most recent call last):
  File "gyb.py", line 60, in <module>
    import httplib2
  File "/home/pi/gyb/httplib2/__init__.py", line 352
    print('%s:' % h, end=' ', file=self._fp)
                    ^
SyntaxError: invalid syntax

I tried to find some information to no avail. I'm on raspbian wheezy and using the latest release.

rakochi commented 9 years ago

Are you running Python 2.x or Python 3? I am not sure what is the earliest version of Python 3 you can install to get this to run, but I installed the latest version of Python 3 to fix this error.

nischg commented 9 years ago

I'm running Python 2, but it seems I'm having some larger issues with Python altogheter, since Flexget isn't working either:

Traceback (most recent call last):
  File "/usr/local/bin/flexget", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: apscheduler
maltokyo commented 9 years ago

it wont run on python 2, at least for me, on Linux or Mac

7k50 commented 9 years ago

OS X 10.11 El Capitan, with Python 2.x I get the exact same syntax error when running: python gyb.py --email=myadress@gmail.com --action=backup

With Python3 I get another error: python3 gyb.py --email=myadress@gmail.com --action=backup

Traceback (most recent call last): File "gyb.py", line 61, in <module> import oauth2client.client File "/got-your-back-0.41/oauth2client/client.py", line 32, in <module> import six ImportError: No module named 'six'

After installing the module six for Python3, I get another error:

Traceback (most recent call last): File "gyb.py", line 1489, in <module> doGYBCheckForUpdates() File "gyb.py", line 316, in doGYBCheckForUpdates f.write(str(now_time)) TypeError: 'str' does not support the buffer interface

shrmnk commented 9 years ago

I resolved the issue by copying six.py downloaded from https://pypi.python.org/pypi/six/#downloads into the root of the project (alongside gyb.py).

(Using a mac, and installed Python 3).

The command is then python3 gyb.py as opposed to python gyb.py

dougjuh commented 9 years ago

I also installed Python 3 on my Mac and gyp now works. To install module 'six', I entered: pip3 install six

To fix the "TypeError: 'str'" errors, see my solution in issue #57.

mikezemans commented 9 years ago

Hello - I too got the initial error at the start of this string, then followed everyone's advice to stomp out subsequent bugs... * was running P2 on OSX 10.8.5, so downloaded/installed Python 3 * downloaded/installed module 'six' * put a copy of 'six.py' into the root of the project folder (alongside 'gyb.py')

However, I know encounter a new error that I'm hoping the group can help me with. When I run...

python3 gyb.py --email MYEMAIL@mydomain.com --action estimate

I now get the error:
File "gyb.py", line 1489, in doGYBCheckForUpdates() File "gyb.py", line 300, in doGYBCheckForUpdates last_check_time = int(f.readline()) ValueError: invalid literal for int() with base 10: b''

Any ideas?

jay0lee commented 8 years ago

this should be fixed in master where six.py is included in source builds. 0.44 will include this fix.