jupyterlab-google-drive icon indicating copy to clipboard operation
jupyterlab-google-drive copied to clipboard

import package from Google Drive

Open OliverEvans96 opened this issue 8 years ago • 2 comments

Say I want to share a notebook which references another python script I wrote, so I include it in the same drive folder as the notebook.

Presently, import myscript from the notebook fails because the script is not actually in my working directory. Is there a way to effectively add the current Drive directory to the python path? Would that involve storing a local copy of scripts?

Cheers, Oliver

OliverEvans96 avatar Jul 20 '17 23:07 OliverEvans96

Unfortunately, you are correct. The Python kernel is running on your local server, and those are the only files it is able to see.

It may be possible to use a fuse-based Google Drive mount, but I have not investigated that.

ian-r-rose avatar Jul 20 '17 23:07 ian-r-rose

Not sure if this helps, but I came across this same problem. It seems like the "working directory" when working with files from Google Drive is the root directory in which JupyterLab was launched.

Copying my script file to that folder worked. Plus output files from the notebook were also written at that same location.

Hope that helps somewhat until a better solution is found.

nyefdo avatar Feb 01 '18 03:02 nyefdo