I installed the google API, pyDrive, and httplib2. I also got a token for my app in google and saved the client_secret.json
file in my project's folder. I'm trying to simply run the following
print(sys.path)
from pydrive.auth import GoogleAuth
gauth = GoogleAuth()
gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication
but it throws a syntax error invalid syntax (auth.py, line 160)
in the line
from pydrive.auth import GoogleAuth
I can authenticate the app using the google drive API (without pydrive) but I'm unable to use pyDrive because of the described error, I've tried to append the following lines at the beginning of the script:
import sys
if "C:\\Users\\giovanni.sumano\\AppData\\Local\\Continuum\\Anaconda3\\Lib\\site-packages\\pydrive" not in sys.path:
sys.path.append("C:\\Users\\giovanni.sumano\\AppData\\Local\\Continuum\\Anaconda3\\Lib\\site-packages\\pydrive")
because C:\\Users\\giovanni.sumano\\AppData\\Local\\Continuum\\Anaconda3\\Lib\\site-packages\\pydrive
is the only path where I've found pydrive libraries, additionally I've tried to add the path to the PYTHONPATH
environment variable via cmd, neither has worked for me so far. Does anybody know how can I make pyDrive work for me?
I'm running python on windows 8.1 and visual studio and python tools for visual studio.