Read file from drive in google colab

前端 未结 5 1370
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 06:24

I Have read the notebook about how to open drive. I already did as instructed using:

from google.colab import drive
drive.mount(\'/content/drive\')
         


        
5条回答
  •  太阳男子
    2021-01-13 07:11

    It is straight forward.

    from google.colab import drive drive.mount('/content/drive')

    This will ask to open a url which will authorize the mount after you copy paste the token.

    If you are not able to read files even now, then prefix your file path with this: 'drive/My Drive' and you are good to go.

    For example: file = 'drive/My Drive/data/file.txt'

    Where data is a directory in my Google Drive containing file.txt file.

提交回复
热议问题