首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jupyterhub未读取配置文件

Jupyterhub未读取配置文件
EN

Stack Overflow用户
提问于 2019-02-06 15:14:27
回答 1查看 368关注 0票数 0

我已经用conda install在Ubuntu 16.04上安装了Jupyterhub。接下来,我通过在jupyterhub_config.py中添加以下内容使其使用oAuthenticator

代码语言:javascript
复制
from oauthenticator.github import GitHubOAuthenticator
c.JupyterHub.authenticator_class = GitHubOAuthenticator
c.GitHubOAuthenticator.create_system_users = True

我还在~/.bashrc中添加了以下内容,并编写了源代码

代码语言:javascript
复制
#For OAuthentication
export GITHUB_CLIENT_ID=id
export GITHUB_CLIENT_SECRET=secret
export OAUTH_CALLBACK_URL=http://xyz:8000/hub/oauth_callback
export GIT_REPO_NAME=mmf
export GIT_BRANCH_NAME=master
export GITHUB_ACCESS_TOKEN= mytoken

在启动jupyterhub之后,我可以看到"login with git“页面。现在,我已经通过创建/etc/systemd/system/jupyterhub.service并向其中添加以下内容,将jupyterhub配置为作为服务运行

代码语言:javascript
复制
[Unit]
Description=Starts JupyterHub as Daemon
After=syslog.target network.target

[Service]
User=root
Environment=”PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/etc/Applications/Anaconda3/bin”
ExecStart=/etc/Applications/Anaconda3/bin/jupyterhub –f /etc/Applications/JupyterHub/jupyterhub_config.py

[Install]
WantedBy=multi-user.target

现在,我使用systemctl start jupyterhub启动它,但是现在我得到的是常规登录页面,而不是git登录页面。

这可能是因为它没有读取jupyterhub_config.py。我检查了jupyterhub.service中提到的所有目录,它们都被检查出来了。

Anaconda安装目录: /etc/Applications/Anaconda3/

Jupyterhub配置文件目录: /etc/Applications/JupyterHub/jupyterhub_config.py

有人能帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2019-02-06 18:18:40

使用以下命令启动Jupyterhub:

jupyterhub -f /etc/Applications/JupyterHub/jupyterhub_config.py

在你的情况下,我猜一定是

systemctl start jupyterhub -f /etc/Applications/JupyterHub/jupyterhub_config.py

用于单据参照

https://jupyterhub.readthedocs.io/en/stable/getting-started/config-basics.html#start-with-a-specific-config-file

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54548376

复制
相关文章

相似问题

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