How to mount GCP Bucket in Google Colab
Asked Answered
L

2

3

I want to access the files in my GCP bucket from Colab. I followed these instructions

As you can see from the screen shots, there is nothing in the folder after mounting. What am I missing? The Data folder in my bucket is full of data.

enter image description here

enter image description here

enter image description here

Loophole answered 4/5, 2020 at 19:52 Comment(1)
try prefixing gs:// to your bucket nameIntegrant
L
8

Turns out you can't mount the bucket name + a path within the bucket. Removing the /Data/ after the name of the bucket led to a successful mount. So since my bucket name is hellonearth, the command is just:

!gcsfuse --implicit-dirs hellonearth myfolder
Loophole answered 5/5, 2020 at 14:8 Comment(0)
M
1

You are using the commands in a wrong way

after !apt -qq install gcsfuse

run:

!mkdir folderOnColab
!gcsfuse gs://folderOnBucket folderOnColab

Then runt !ls instead of just ls

Millner answered 4/5, 2020 at 20:18 Comment(1)
The gs:// prefix is not necessary - in fact, in gcsfuse v2.0.1, gcsfuse gs://mybucket /mount/point raises the "bucket doesn't exist" error, while removing the prefix fixes the issue (no pun intended). See the documentation for details.Branchia

© 2022 - 2025 — McMap. All rights reserved.