【问题标题】:Getting 404 for jupyterLab on jupyterHub在 jupyterHub 上为 jupyterLab 获取 404
【发布时间】:2021-09-12 01:26:34
【问题描述】:

所以我正在尝试在生产模式 (Centos) 下使用 JupyterLab 设置 JupyterHub 服务。为简单起见,我选择了系统用户身份验证 (PAM)。所以现在我有几个用户能够运行单个服务器。问题是我需要设置一个 JupyterLab 才能正常工作。 我做了所有 jupyterhub 文档告诉我要做的事情(可能还有更多):

  1. 在系统范围内启用 jupyterlab 扩展 (jupyter serverextension enable --py jupyterlab --sys-prefix)
  2. 添加了所需的配置选项 (c.Spawner.cmd = ["jupyter-labhub"])
  3. 其他一些没用的东西 但是/lab url 仍然返回 404 错误。 相关控制台输出:
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]: Message: '404 GET /user/nataliya/lab (nataliya@::ffff:127.0.0.1) 57.16ms'                                
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]: Arguments: ()                                                                                           
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]: --- Logging error ---                                              
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]: Traceback (most recent call last):                                                                       Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]:  File "/usr/local/lib64/python3.8/site-packages/tornado/web.py", line 1681, in _execute
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]:    result = self.prepare()                                                                               
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]:  File "/usr/local/lib/python3.8/site-packages/notebook/base/handlers.py", line 697, in prepare          
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]:    raise web.HTTPError(404)                                                                              
Jun 29 14:48:51 jupyter-infra-1 pipenv[11806]: tornado.web.HTTPError: HTTP 404: Not Found

可能与控制台输出无关:

Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:    raise web.HTTPError(404, u'Kernel does not exist: %s' % kernel_id)                                    
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]: tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: d85c98fa-2998-4fb3-85e2-8dc6ecbd093a) 
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]: During handling of the above exception, another exception occurred:                                     
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]: Traceback (most recent call last):                                                                      
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:  File "/usr/lib64/python3.8/logging/__init__.py", line 1081, in emit                                     
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:    msg = self.format(record)                                                                            
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:  File "/usr/lib64/python3.8/logging/__init__.py", line 925, in format                                   
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:    return fmt.format(record)                                                                             
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:  File "/usr/local/lib64/python3.8/site-packages/tornado/log.py", line 196, in format                     
Jun 29 14:39:36 jupyter-infra-1 pipenv[11806]:    formatted = self._fmt % record.__dict__      

我没有任何想法,因此将不胜感激。

【问题讨论】:

    标签: centos jupyter jupyterhub


    【解决方案1】:

    所以,我通过 pip3 安装 jupyterlab 包来解决这个问题。 事情就是这样:

    1. 我尝试为具有/home/jupyterhub/.local/bin/pipenv run jupyter serverextension enable --py jupyterlab --user 的用户启用 jupyterlab 但这会给我带来异常:

    ModuleNotFoundError: 没有名为“jupyterlab”的模块 我重新检查了我的 Pipfile.lock 是否包含一个 jupyterlab 扩展......它是! 2.我尝试用最标准的方式安装jupyterlab:

    pip3 install jupyterlab

    它做了一件事!

    仍然不确定为什么用 pipenv 安装的 jupyterlab 没有结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-08
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 2021-12-08
      • 1970-01-01
      • 1970-01-01
      • 2016-01-05
      相关资源
      最近更新 更多