【发布时间】:2016-03-10 21:57:00
【问题描述】:
我正在尝试利用 runipy 和 osx 的 launchd 定期运行 jupyter notebook。
这可以从命令行工作
/path/to/interpreter/python.3.4 /path/to/runipy/main.py /path/to/notebook/nb.ipynb
但是launchd plist 中的类似方法无法启动笔记本
<key>ProgramArguments</key>
<array>
<string/path/to/interpreter/python.3.4</string>
<string/path/to/runipy/main.py</string>
<string/path/to/notebook/nb.ipynb</string>
</array>
当我检查控制台日志时,我只看到了这个神秘的错误
Service exited with abnormal code: 1
关于为什么失败的任何想法?
注意:我目前正在使用 launchd 在这台机器上使用类似的方法运行 py 文件。
更新:
根据 wij 的建议,我在 plist 中添加了以下几行
<key>StandardErrorPath</key>
<string>/tmp/com.your.thing.err</string>
<key>StandardOutPath</key>
<string>/tmp/com.your.thing.out</string>
得到了
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3940: ordinal not in range(128)
【问题讨论】:
标签: python macos launchd jupyter-notebook