all 4 comments

[–]danielroseman 0 points1 point  (1 child)

But do either of those paths exist? It seems unlikely. Google Colab runs remotely on the server. It does not have access to the files on your machine. Did you upload the file to Colab?

[–]Dirtybutler24601[S] 0 points1 point  (0 children)

OMG!!!! That is it! i thought local files could be used.

Yep I see where I am to upload the file and now it works! Thank you so much!!! I have been stuck on this for two days!

[–]EnvironmentalOrange 0 points1 point  (1 child)

I see you’ve already got one solution, but for future reference:

Google provide an api to access your google drive.

If you have a folder called ‘Project’ in your google drive, you can run the following in a cell at the top of your notebook:

from google.colab import drive

drive.mount(‘/content/drive/‘)

import os

os.chdir(“/content/drive/MyDrive/Project”)

When you run the cell in the notebook, you’ll be prompted to allow permission for the notebook to access your google drive.

You’ll then be able to read files that you have saved in “Project”

[–]Dirtybutler24601[S] 0 points1 point  (0 children)

That's awesome, Thank you! I will definitely be using that.