【问题标题】:Sagemath Jupyter Kernel install error after conda-forge installationconda-forge 安装后 Sagemath Jupyter 内核安装错误
【发布时间】:2021-06-14 07:48:54
【问题描述】:

所以我使用 conda install sage python jupyterlab 通过 anaconda 安装了 SageMath。

然后我去通过jupyter kernelspec install --user ~/miniconda3/envs/sage/share/jupyter/kernels/sagemath 安装sage jupyter 内核,就像在this thread 中一样

但此命令失败并出现以下错误

Traceback (most recent call last):
  File "/Users/llamagod/miniconda3/envs/sage/bin/jupyter-kernelspec", line 10, in <module>
    sys.exit(KernelSpecApp.launch_instance())
  File "/Users/llamagod/miniconda3/envs/sage/lib/python3.9/site-packages/traitlets/config/application.py", line 845, in launch_instance
    app.start()
  File "/Users/llamagod/miniconda3/envs/sage/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 266, in start
    return self.subapp.start()
  File "/Users/llamagod/miniconda3/envs/sage/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 132, in start
    self.kernel_spec_manager.install_kernel_spec(self.sourcedir,
  File "/Users/llamagod/miniconda3/envs/sage/lib/python3.9/site-packages/jupyter_client/kernelspec.py", line 340, in install_kernel_spec
    shutil.copytree(source_dir, destination)
  File "/Users/llamagod/miniconda3/envs/sage/lib/python3.9/shutil.py", line 557, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/Users/llamagod/miniconda3/envs/sage/lib/python3.9/shutil.py", line 513, in _copytree
    raise Error(errors)
shutil.Error: [('/Users/llamagod/miniconda3/envs/sage/share/jupyter/kernels/sagemath/doc', '/Users/llamagod/Library/Jupyter/kernels/sagemath/doc', "[Errno 2] No such file or directory: '/Users/llamagod/miniconda3/envs/sage/share/jupyter/kernels/sagemath/doc'")]

我尝试将 $SAGE_LOCAL/share/doc 符号链接到该目录,但我得到了同样的错误。

SageMath 9.2、JupyterLab 3.0.16

这是一个已知问题吗?

【问题讨论】:

    标签: jupyter sage


    【解决方案1】:

    最后我使用this page 中描述的替代方法来安装内核并避免复制文档。

    ln -s `sage -sh -c 'ls -d $SAGE_LOCAL/share/jupyter/kernels/sagemath'` $HOME/miniconda3/envs/sage/share/jupyter
    

    所以我现在可以在我的 conda 环境中从 jupyter 运行 sagemath 内核。

    【讨论】:

      猜你喜欢
      • 2017-01-10
      • 2020-10-22
      • 2020-07-17
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多