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

Jonah Geladze picture Jonah Geladze · Sep 18, 2019 · Viewed 10.8k times · Source

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

Answer

Suleman picture Suleman · Jan 20, 2020
  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