Dan O'Boyle
Dan O'Boyle

Reputation: 3766

Syntax Error in google-api-python-client

While attempting to follow the Appengine quickstart the following error message appears:

httplib2/__init__.py", line 352 print('%s:' % h, end=' ', file=self._fp) ^ SyntaxError: invalid syntax

Upvotes: 1

Views: 2114

Answers (2)

xgMz
xgMz

Reputation: 3354

I had the same issue but my solution was to run pip in a virtual environment for the correct Python version, in my case it was 2.7.

virtualenv --python=python2.7 .venv27
source .venv27/bin/activate
pip2.7 install -r requirements.txt -t lib

Upvotes: 1

Dan O'Boyle
Dan O'Boyle

Reputation: 3766

When installing google-api-python-client, the following is recommended:

pip install -t lib google-api-python-client

If this command is used in an enviornment running python 3, the lib installed copy will fail.
Better to explicily state pip2:

pip2 install -t lib google-api-python-client

Upvotes: 0

Related Questions