iterative / PyDrive2

Google Drive API Python wrapper library. Maintained fork of PyDrive.
https://docs.iterative.ai/PyDrive2
Other
570 stars 70 forks source link

Fail to authenticate with pydrive2 to google drive #300

Open andrei-volkau opened 1 year ago

andrei-volkau commented 1 year ago

I am using the following standard code.

from pydrive2.drive import GoogleDrive
from pydrive2.auth import GoogleAuth

# Authenticate and create the PyDrive client.
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)

I am getting the following error.

Screenshot 2023-08-30 at 23 20 38

I am using MacOS (intel).

I was able to find such issue in stackoverflow also

https://stackoverflow.com/questions/64995468/fail-to-authenticate-with-pydrive-to-google-drive

The solution from stackoverflow is not working for me.

I am using PyDrive2 1.17.0

How can I sole the issue? I am using port 8080. Should I try another port?

shcheklein commented 1 year ago

What do you see in the command line when you run it and try to connect?

andrei-volkau commented 1 year ago

What do you in the command line when you run it and try to connect?

I simply execute my script via python

For example, python main.py

shcheklein commented 1 year ago

@andrei-volkau sorry, do you see any output there?

casesolved-co-uk commented 4 months ago

Are you running the code natively or in a docker image (like a colab runtime)?

Try seeing if the webserver is listening on port 8080 using lsof -i Also try doing a tcpdump to see if the packets come through tcpdump -i lo -vvv port 8080

if in docker you'll have to pass port 8080 through to the main OS -p 127.0.0.1:8080:8080