gdrive | Google Drive CLI Client | Command Line Interface library
kandi X-RAY | gdrive Summary
kandi X-RAY | gdrive Summary
gdrive is a command line utility for interacting with Google Drive.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gdrive
gdrive Key Features
gdrive Examples and Code Snippets
def get_gdrive_service():
creds = None
# The file token.pickle stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.pickle
Community Discussions
Trending Discussions on gdrive
QUESTION
Since yesterday I have had the problem that I can no longer mount my Google account. Normally, when I run it, I get a link to authorize myself with. Now, when the code is executed, an extra browser window is opened where I should authorize myself. But if I do it over it, it doesn't work. Do you know why it can be that this authorization link is suddenly no longer shown? Any security setting maybe? I've tried several browsers.
EDIT: With the new authorization popup it works if i mount the google drive from the same google account like colab. But the problem is that my main google drive is on another account than Google Colab. With the link it used to work without any problems earlier...
EDIT 2: I have now solved it in such a way that I have shared the required folder for my other account and can now access it via my Colab Google Drive account. But I still didn't manage to get the link back.
After the code execution and authorization with the new popup i get this error message on Google Colab:
MessageError Traceback (most recent call last) in () 1 #Connect Google Drive 2 from google.colab import drive ----> 3 drive.mount('/gdrive')
3 frames /usr/local/lib/python3.7/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec) 104 reply.get('colab_msg_id') == message_id): 105 if 'error' in reply: --> 106 raise MessageError(reply['error']) 107 return reply.get('data', None) 108
MessageError: Error: credential propagation was unsuccessful
I use this code:
...ANSWER
Answered 2021-Nov-07 at 20:45This is a problem with Google Colab Pro. I have a Pro account as well as a normal account. My normal account works as intended (with the link) whereas my Pro account has the pop-up window that gives me the same error as OP.
QUESTION
recently colab removed the ability to connect to google drive from different accounts other than the one you were logged into in google drive. There was a workaround someone posted with the following code which worked great, until now...
...ANSWER
Answered 2022-Mar-31 at 16:39QUESTION
I'm having a problem trying to run "dvc pull" on Google Colab. I have two repositories (let's call them A and B) where repository A is for my machine learning codes and repository B is for my dataset.
I've successfully pushed my dataset to repository B with DVC (using gdrive as my remote storage) and I also managed to successfully run "dvc import" (as well as "dvc pull/update") on my local project of repository A.
The problem comes when I use colab to run my project. So what I did was the following:
- Created a new notebook on colab
- Successfully git-cloned my machine learning project (repository A)
- Ran "!pip install dvc"
- Ran "!dvc pull -v" (This is what causes the error)
On step 4, I got the error (this is the full stack trace)
...ANSWER
Answered 2022-Mar-11 at 18:08To summarize the discussion in the comments thread.
Most likely it's happening since DVC can't get access to a private repo on GitLab. (The error message is obscure and should be fixed.)
The same way you would not be able to run:
QUESTION
I'm trying in google colab to get the file ID of a file stored on my google drive.
When the file is created by a function inside google colab, I get a file ID in the form of "local-xxx" instead of the actual file ID. When the file is manually uploaded to google drive, I get the correct ID.
Could you please help me fix this? Posting my code below
...ANSWER
Answered 2022-Mar-09 at 13:01You might want to check out this answer to a related question.
It contains the implementation of a workaround based on the following observation (from another answer in the same thread):
Note: If you are using this in some type of script that is creating new files/folders and quickly reading the 'user.drive.id' afterwards, be aware that it can take many seconds for the "real" file id to be generated. If you read the value of 'user.drive.id' and it starts with 'local', this means that it has not yet generated an actual file id. In my opinion, the best way to deal with this is to create an asynchronous loop that sleeps between checks, and then returns the file id once it no longer starts with 'local'.
ps. I would rather post this as a comment, but I don't have enough rep points yet ;-)
QUESTION
Using my answer to my question on how to download files from a public Google drive I managed in the past to download images using their IDs from a python script and Google API v3 from a public drive using the following bock of code:
...ANSWER
Answered 2022-Mar-04 at 12:57Well thanks to the security update released by Google few months before. This makes the link sharing stricter and you need resource key as well to access the file in-addition to the fileId
.
As per the documentation , You need to provide the resource key as well for newer links, if you want to access it in the header X-Goog-Drive-Resource-Keys
as fileId1/resourceKey1
.
If you apply this change in your code, it will work as normal. Example edit below:
QUESTION
So I wrote a to-do list app, following a youtube tutorial, but it does not work as intended, it does not save the changes made so when you open the app again it starts as nothing happened. I installed async storage with the command npm i @react-native-async-storage/async-storage
and linked it with the command react-native link
. Maybe I'm linking it wrong or idk I'm completely new to this.
Here's the App.js:
ANSWER
Answered 2022-Feb-26 at 20:21You have a typo in your code
You set an item with this line of code
QUESTION
I have many images in a folder and I am want to delete images of the same size. My code below, using PIL, works but I want to know if there is a more efficient way to achieve this.
...ANSWER
Answered 2022-Feb-23 at 09:16You can keep a dictionary of sizes and delete any images that have a size that have already been seen. That way you don't need a nested loop, and don't have to create Image objects for the same file multiple times.
QUESTION
I have pretrained model for object detection (Google Colab + TensorFlow) inside Google Colab and I run it two-three times per week for new images I have and everything was fine for the last year till this week. Now when I try to run model I have this message:
...ANSWER
Answered 2022-Feb-07 at 09:19It happened the same to me last friday. I think it has something to do with Cuda instalation in Google Colab but I don't know exactly the reason
QUESTION
In gSheets, I wrote an apps script which creates a DocX file based on a gDoc. The DocX file is then moved to the target folder, which is a shared gDrive folder.
Here's the code snippet:
...ANSWER
Answered 2022-Jan-20 at 16:06In your code I can't see subFolder
definition. Is it folder ID? If so, for moveTo()
method to work you need to get that folder first:
QUESTION
I am learning to use the Google Drive API and started with a small script isloated away from anything:
...ANSWER
Answered 2021-Dec-29 at 15:26Invalid service account credentials
Normally means that the key fine you are using is invalid. You need to create a service account key file.
If you open the json key file it should look something like this
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gdrive
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page