提问人:oceanpath 提问时间:5/27/2022 更新时间:5/27/2022 访问量:1767
FileNotFoundError:[Errno 2] 没有这样的文件或目录 [在 google colab 中从我的计算机打开电子表格]
FileNotFoundError: [Errno 2] No such file or directory [opening spreadsheets from my computer in google colab]
问:
我正在尝试在 google colab 中从我的计算机打开电子表格,此错误正在返回。
/usr/local/lib/python3.7/dist-packages/pandas/io/common.py in get_handle(path_or_buf, mode, encoding, compressio
n, memory_map, is_text, errors, storage_options)
709 else:
710 # Binary mode
--> 711 handle = open(handle, ioargs.mode)
712 handles.append(handle)
713
FileNotFoundError: [Errno 2] No such file or directory:
电子表格是否必须位于特定目录中? 它可以在我的桌面上吗?我应该如何复制其地址?
答:
0赞
oceanpath
5/27/2022
#1
解决!!
我试过了
drive.mount('/content/gdrive')
from google.colab import files
dataset_file_dict = files.upload()
然后出现了一个“搜索”窗口,所以我可以直接在桌面上搜索我的文件。
非常感谢!
评论
(Files)
from google.colab import files dataset_file_dict = files.upload()
test_file = open('/content/your_file.txt', "r")
from google.colab import drive drive.mount('/content/gdrive')
text_file = "/content/gdrive/MyDrive/folderName/your-file.txt"