Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ValueError: Mountpoint must not contain a space. (Colab)

Here is my code in google colab:

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

I have a path which contains space symbol and I get this error:

/usr/local/lib/python3.6/dist-packages/google/colab/drive.py in mount(mountpoint, force_remount, timeout_ms) 89 90 if ' ' in mountpoint: ---> 91 raise ValueError('Mountpoint must not contain a space.') 92 93 mountpoint = _os.path.expanduser(mountpoint)

ValueError: Mountpoint must not contain a space.

I have tried drive.mount('content/drive/My\ Drive/ML') and this doesn't work

like image 353
Jonah Geladze Avatar asked Sep 18 '19 14:09

Jonah Geladze


People also ask

How do I import a folder into Colab?

Access local files through the file-explorer You can either use the upload option at the top of the file-explorer pane to upload any file(s) from your local file system to Colab in the present working directory. 2. Select the “upload” option.


1 Answers

  1. Mount at /content/drive

    from google.colab import drive
    drive.mount('/content/drive')
    
  2. Change directory using cd command

    cd 'drive/My Drive'
    

enter image description here

like image 142
Suleman Avatar answered Oct 07 '22 19:10

Suleman