Почему я получаю эту ошибку ядра Sage в Jupyter? - PullRequest
0 голосов
/ 10 октября 2019

При открытии ноутбука Jupyter я получаю следующую ошибку ядра:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(*exc_info)  # type: ignore
File "/usr/local/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 72, in post
type=mtype))
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(*exc_info)  # type: ignore
File "/usr/local/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(*exc_info)  # type: ignore
File "/usr/local/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 101, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/local/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper
yielded = next(result)
File "/usr/local/lib/python3.7/site-packages/notebook/services/kernels/kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/usr/local/lib/python3.7/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/usr/local/lib/python3.7/site-packages/jupyter_client/manager.py", line 259, in start_kernel
**kw)
File "/usr/local/lib/python3.7/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/usr/local/lib/python3.7/site-packages/jupyter_client/launcher.py", line 138, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/buildbot-sage/slave/binary_pkg/build/source/SageMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas3/local/bin/sage': '/Users/buildbot-sage/slave/binary_pkg/build/source/SageMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas3/local/bin/sage'

Кроме того, когда я запускаю ноутбук Jupyter из Sage, я также получаю ошибку ядра:

Traceback (most recent call last):
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/web.py", line 1511, in _execute
result = yield result
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/tornado/gen.py", line 307, in wrapper
yielded = next(result)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/notebook/services/kernels/kernelmanager.py", line 160, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/jupyter_client/manager.py", line 259, in start_kernel
**kw)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/site-packages/jupyter_client/launcher.py", line 138, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/Applications/SageMath-8.9.app/Contents/Resources/sage/local/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Теперь позвольте мне рассказать вам, как именно я установил Jupyter и Sage. Я использую MacOS, поэтому я установил Jupyter с Brew:

pip3 install jupyter

, а затем я установил Sage:

brew install cask
brew cask install sage

Наконец, я установил Sage в Jupyter:

jupyter kernelspec install --user /Applications/SageMath-8.9.app/Contents/Resources/sage/local/share/jupyter/kernels/sagemath

и затем я сделал:

export SAGE_ROOT=/Applications/SageMath-8.9.app/Contents/Resources/sage

Когда я пишу «список спецификаций ядра jupyter», я получаю:

sagemath    /Users/inesguimaraes/Library/Jupyter/kernels/sagemath
python3     /usr/local/share/jupyter/kernels/python3

И kernel.json внутри ядра Sageв Jupyter выглядит так:

{"display_name": "SageMath 8.9", "language": "sage", "argv": ["/Users/buildbot-sage/slave/binary_pkg/build/source/SageMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas3/local/bin/sage", "--python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"]}

Я знаю, что этот пост действительно длинный и скучный, но может кто-нибудь сообразить, что происходит? Я думаю, что Jupyter не получает вещи, откуда он должен или что-то ... Любая помощь высоко ценится. Заранее спасибо!

...