在 JupyterLab 中读取 Google Drive 中的文件

Yai*_*irh 6 google-drive-api jupyter-lab

我已经安装了 jupyter lab 扩展来连接到谷歌驱动器。我可以从 JupyterLab UI 创建并打开驱动器中的文件。但我找不到读取笔记本驱动器中文件的方法。例如,我希望能够在我的笔记本中运行以下命令:

df = pd.read_csv("Gdrive/MyDrive/somefileinthedrive.csv")
Run Code Online (Sandbox Code Playgroud)

有什么建议 ?

San*_*rea 5

您可以直接在 Google Drive 目录中打开 jupyterlab,如下答案:/sf/answers/4835456041/

我用来从 anaconda 提示符中打开 jupyterlab:

python -m jupyterlab --notebook-dir=G:/
Run Code Online (Sandbox Code Playgroud)

注意:如果您愿意,可以更改G:/为另一个目录。