centos - 在 jupyterHub 上为 jupyterLab 获取 404

标签 centos jupyter jupyterhub

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

  • 在系统范围内启用 jupyterlab 扩展 ( jupyter serverextension enable --py jupyterlab --sys-prefix )
  • 添加了所需的配置选项 ( c.Spawner.cmd = ["jupyter-labhub"] )
  • 其他一些没用的东西
    但是 /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__      
    
    我没有任何想法,因此将不胜感激。

    最佳答案

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

  • 我尝试为具有 /home/jupyterhub/.local/bin/pipenv run jupyter serverextension enable --py jupyterlab --user 的用户启用 jupyterlab
    但那返回我异常:

  • ModuleNotFoundError: No module named 'jupyterlab' I re-checked that my Pipfile.lock includes a jupyterlab extension... and it was! 2. I tried to install jupyterlab with the most standart way:

    pip3 install jupyterlab它做了一件事!
    仍然不确定为什么使用 pipenv 安装的 jupyterlab 没有结果。

    关于centos - 在 jupyterHub 上为 jupyterLab 获取 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68185409/

    相关文章:

    linux - 如何使用静态 IP 地址设置主机和 httpd.conf 文件

    python - 内核在 Jupyter Notebook 中自动完成(制表符)的时间太长

    ipython - 使用 Markdown 格式化代码单元格的输出

    docker - Kubernetes:为什么我的 NodePort 无法获取外部 ip?

    Jupyter 中忽略 Kubernetes 服务帐户 token

    centos - 尝试更新 repo 时,使用 centos :6. 6 构建 docker 镜像失败

    python - 如何在 Python 脚本中可靠地检查我是否高于某个 CentOS 版本(CentOS 7)?

    hadoop - 快速启动 VM 5.5 无法在 VirtualBox 5.0.14 上启动

    python - 有没有办法在 Jupyter Lab 中切换单元格输出?

    python - 让 Pyspark 在 jupyterhub 中工作