首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >奇点容器中的Jupyter Notebook

问奇点容器中的Jupyter Notebook
EN

Stack Overflow用户
提问于 2020-08-31 07:10:28
回答 1查看 396关注 0票数 1

当我进入奇点容器后,如何让jupyter笔记本在我的浏览器上运行--我找不到很多关于它的文档?我使用的是centos linux发行版,我必须通过ssh进入它。

容器中已经安装了Jupyter。在singularity shell --writable ....sif之后,如何让jupyter笔记本在浏览器上运行?basic:jupyter notebook --no-browser --port=7800返回这个错误:

代码语言:javascript
复制
Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/opt/conda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/notebook/notebookapp.py", line 1628, in initialize
    self.init_configurables()
  File "/opt/conda/lib/python3.6/site-packages/notebook/notebookapp.py", line 1319, in init_configurables
    connection_dir=self.runtime_dir,
  File "/opt/conda/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "/opt/conda/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "/opt/conda/lib/python3.6/site-packages/jupyter_core/application.py", line 99, in _runtime_dir_default
    ensure_dir_exists(rd, mode=0o700)
  File "/opt/conda/lib/python3.6/site-packages/jupyter_core/utils/__init__.py", line 13, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/opt/conda/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/opt/conda/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/run/user/19241'
EN

回答 1

Stack Overflow用户

发布于 2020-08-31 15:38:18

启动notebook后,输出中会给出一个链接,您只需将该链接粘贴到浏览器中即可。请参见下面的示例输出。

您确定镜像已成功构建/完全传输吗?我无法复制这个错误。如果仍然出现该错误,请使用定义文件/如何生成镜像的命令更新问题。

代码语言:javascript
复制
$ singularity pull docker://jupyter/scipy-notebook
INFO:    Converting OCI blobs to SIF format
INFO:    Starting build...
Getting image source signatures
Copying blob 692c352adcf2 done
...
2020/08/31 09:23:15  info unpack layer: sha256:2be4f33acc3414896b4c608db82138711c62386174f91319cd1f317b54431fda
INFO:    Creating SIF file...
INFO:    Build complete: scipy-notebook_latest.sif

$ singularity shell scipy-notebook_latest.sif 
Singularity> jupyter notebook --no-browser --port=7800
[I 09:28:37.259 NotebookApp] Writing notebook server cookie secret to /home/tsnowlan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 09:28:38.266 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.8/site-packages/jupyterlab
[I 09:28:38.266 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 09:28:38.269 NotebookApp] Serving notebooks from local directory: /data/playground/jupyter
[I 09:28:38.269 NotebookApp] Jupyter Notebook 6.1.3 is running at:
[I 09:28:38.269 NotebookApp] http://localhost:7800/?token=xxxx
[I 09:28:38.269 NotebookApp]  or http://127.0.0.1:7800/?token=xxxx
[I 09:28:38.269 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 09:28:38.273 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/tsnowlan/.local/share/jupyter/runtime/nbserver-114505-open.html
    Or copy and paste one of these URLs:
        http://localhost:7800/?token=xxxx
     or http://127.0.0.1:7800/?token=xxxx
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63662961

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档