【发布时间】:2018-12-31 15:30:57
【问题描述】:
我一直在运行 jupyterhub 0.91。在 MacOS Sierra(版本 10.12.6)中成功,并且可以从连接到此 MacOS 网络的任何客户端访问笔记本。我试图将 jupyterhub 作为一项服务。为此,我在 /Users/xyz/Library/LaunchAgents 中创建了 org.xyz.jupyter.plist 文件(xyz 是我的用户 ID ) 具有以下内容(为简洁起见,省略了标准页眉和页脚信息):
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.xyz.jupyter</string>
<key>ProgramArguments</key>
<array>
<string>/Users/xyz/Library/LaunchAgents/jupyterhub.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/Shared/jupyterhub.err</string>
<key>StandardOutPath</key>
<string>/Users/Shared/jupyterhub.out</string>
<key>KeepAlive</key>
<true/>
</dict>
并且,/Users/xyz/Library/LaunchAgents/jupyterhub.sh的内容是:
PID=$(pgrep -f jupyterhub)
if [ "x$PID" = "x" ]; then # Ensure only one jupyterhub instance is running
sudo /opt/anaconda/anaconda3/bin/jupyterhub -f /Users/Shared/jupyterhub_config.py
fi
我独立运行了上述 shell 脚本,jupyterhub 启动时没有出现任何问题。但是,当我重新启动 Mac 以自动启动集线器时,出现以下错误(摘录):
File "/opt/anaconda/anaconda3/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'configurable-http-proxy': 'configurable-http-proxy'
我检查了执行 jupyterhub 的位置 /opt/anaconda/anaconda3/bin/ 并找到了文件 configurable-http-proxy。然后,我将它复制到: /opt/anaconda/anaconda3/lib/python3.6 从中执行 subprocess.py 并报告缺少 configurable-http-proxy。尽管如此,错误仍然是一样的。请帮忙?
【问题讨论】:
标签: macos http-proxy jupyterhub