Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileNotFoundError: [Errno 2] No such file or directory google colab

I am getting this error everytime running python code on local data from my drive I am using the code below to import the data from my drive

from google.colab import drive
drive.mount('/content/drive')
like image 948
lavender Avatar asked Feb 14 '19 11:02

lavender


People also ask

How do I load data on Google Colab?

Uploading files from local file system through 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.

How do I import image dataset in Google Colab?

Step 2: Select any Dataset and Click on the Download. Step 3: The downloaded file will be in Zip form, Unzip it. Step 4: Upload Your Dataset file or folder to Google Colab Notebook.

How do I mount on Google Colab?

Instructions. Place the Jupyter notebook in your Google Drive. In Google Drive in your web browser, open the Jupyter notebook with Colaboratory. Run the cells in this notebook to mount the drive and practice reading & writing files.

How do I save a colab file as a driver?

Path to save in drive can be found easily by clicking files on left side, navigating to folder and right click to choose Copy path .


2 Answers

Check if your file exists in this "/content/drive/" location

import os
os.chdir("/content/drive/")
!ls

Most likely it would be under 'My Drive'

import os
os.chdir("/content/drive/My Drive")
!ls
like image 165
Rishabh Gupta Avatar answered Oct 24 '22 07:10

Rishabh Gupta


google has changed to Mydrive and deleted space. so no "My Drive" but "MyDrive os.chdir('/content/gdrive/MyDrive/iss/vse/data/')

like image 24
Taksh Avatar answered Oct 24 '22 08:10

Taksh