简体   繁体   English

在 amazon ec2 上访问 jupyter notebook 中安装的数据

[英]access mounted data in jupyter notebook on amazon ec2

I am trying to run a jupyter notebook using data and notebooks that are mounted on an EBS volume on my ec2 instance.我正在尝试使用安装在我的 ec2 实例上的 EBS 卷上的数据和笔记本来运行 jupyter 笔记本。 My ec2 instance uses ubuntu.我的 ec2 实例使用 ubuntu。 My directory structure looks like the following:我的目录结构如下所示:

/ /

---|mountedData ---|安装数据

---|localData ---|本地数据

I used the instructions provided here here to set up the notebook.我使用此处提供的说明来设置笔记本。 When I invoke the jupyter notebook command from / or from /localData it is successful.当我从//localData调用 jupyter notebook 命令时,它是成功的。 However, I can't navigate to the /mountedData directory (it doesn't even show up on the browser's file navigation screen).但是,我无法导航到/mountedData目录(它甚至没有显示在浏览器的文件导航屏幕上)。 If I launch the jupyter notebook from within /mountedData I get an error in the browser如果我从/mountedData中启动 jupyter 笔记本,我会在浏览器中收到错误消息

Server error: Traceback (most recent call last): File "/snap/jupyter/6/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute result = await result File "/snap/jupyter/6/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper yielded = next(result) File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/services/contents/handlers.py", line 112, in get path=path, type=type, format=format, content=content, File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/services/contents/filemanager.py", line 431, in get model = self._dir_model(path, content=content) File "/snap/jupyter/6/lib/python3.7/site-packages/notebook/services/contents/filemanager.py", line 313, in _dir_model for name in os.listdir(os_dir): PermissionError: [Errno 13] Permission denied: '/var/lib/snapd/void'`

All directories are owned by root and root is the usergroup.所有目录都归 root 所有,root 是用户组。 I even tried chmod 777'ing the /mountedData but that didn't help.我什至尝试 chmod 777'ing /mountedData但这没有帮助。 I also tried symlinking the mounted data within /localData as I saw suggested online but that produces a 404 not found error when I try to click on the symlink.我还尝试对/localData中的已安装数据进行符号链接,正如我在网上看到的建议,但是当我尝试单击符号链接时会产生 404 not found 错误。 Unfortunately ditching the mounted data is not an option as I am working with TBs of data that I need to mount and attach to ec2 instances.不幸的是,放弃已安装的数据不是一种选择,因为我正在处理需要安装并附加到 ec2 实例的 TB 数据。 Thanks for the help!谢谢您的帮助!

I managed to solve this problem by uninstalling the version of jupyter I had installed via snap, then reinstalling jupyter via anaconda.我设法通过卸载我通过 snap 安装的 jupyter 版本解决了这个问题,然后通过 anaconda 重新安装 jupyter。 So the moral of the story is to use anaconda to install python packages!所以故事的寓意是使用 anaconda 安装 python 包!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM