Jupyter Lab Cron作业失败KeyError:用户
我正在使用Ancaconda的Jupyter Lab安排一些Jupyter笔记本。
我安装了jupyterlab_scheduler,当我尝试安排一个cronjob时,我会遇到“有错误提交作业”的错误。
我的cron语法是1 14 * * * *
,该作业的命令是jupyter nbconvert - to Notebook -ececute c:/users/users/charl/conversion率sdr.ipynb
我的日志看起来像这样:
[E 2022-06-06 14:21:15.410 ServerApp] Uncaught exception POST /jupyterlab_scheduler/add?1654539675407 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/jupyterlab_scheduler/add?1654539675407', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "c:\users\charl\anaconda3\lib\site-packages\tornado\web.py", line 1702, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "c:\users\charl\anaconda3\lib\site-packages\tornado\web.py", line 3173, in wrapper
return method(self, *args, **kwargs)
File "c:\users\charl\anaconda3\lib\site-packages\jupyterlab_scheduler\handlers.py", line 114, in post
with CronTab(user=os.environ["USER"]) as cron:
File "c:\users\charl\anaconda3\lib\os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'USER'
[W 2022-06-06 14:21:15.412 ServerApp] Unhandled error
[E 2022-06-06 14:21:15.414 ServerApp] {
"Host": "localhost:8888",
"Accept": "*/*",
"Referer": "http://localhost:8888/lab",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36"
}
[E 2022-06-06 14:21:15.415 ServerApp] 500 POST /jupyterlab_scheduler/add?1654539675407 (::1)
3.99ms referer=http://localhost:8888/lab
I'm using Jupyter Lab with ancaconda to schedule some Jupyter Notebooks.
I installed jupyterlab_scheduler and when I try to schedule a cronjob I get the error "There was an error submitting job".
My cron syntax is 1 14 * * *
and the command for the job is jupyter nbconvert --to notebook --execute C:/Users/charl/conversion rates sdr.ipynb
My log looks like this :
[E 2022-06-06 14:21:15.410 ServerApp] Uncaught exception POST /jupyterlab_scheduler/add?1654539675407 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/jupyterlab_scheduler/add?1654539675407', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "c:\users\charl\anaconda3\lib\site-packages\tornado\web.py", line 1702, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "c:\users\charl\anaconda3\lib\site-packages\tornado\web.py", line 3173, in wrapper
return method(self, *args, **kwargs)
File "c:\users\charl\anaconda3\lib\site-packages\jupyterlab_scheduler\handlers.py", line 114, in post
with CronTab(user=os.environ["USER"]) as cron:
File "c:\users\charl\anaconda3\lib\os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'USER'
[W 2022-06-06 14:21:15.412 ServerApp] Unhandled error
[E 2022-06-06 14:21:15.414 ServerApp] {
"Host": "localhost:8888",
"Accept": "*/*",
"Referer": "http://localhost:8888/lab",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36"
}
[E 2022-06-06 14:21:15.415 ServerApp] 500 POST /jupyterlab_scheduler/add?1654539675407 (::1)
3.99ms referer=http://localhost:8888/lab
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
堆栈跟踪说,环境变量
用户
找不到。用户
如果使用Linux,则默认情况下定义,但如果您使用的是Windows。看来该软件包是为Linux用户设计的。您可以通过定义
用户
环境变量手动。The stack trace is saying that the environment variable
USER
is not found.USER
is defined by default if you are using Linux, but not if you are using Windows.It appears that the package is designed for Linux users. You can get around this particular issue by defining the
USER
environment variable manually.