gpt4 book ai didi

jupyter kernelspec 没有这样的文件或目录/lib/libstdc++.so.6.0.21

转载 作者:行者123 更新时间:2023-12-02 02:43:43 29 4
gpt4 key购买 nike

在用户创建环境并希望与其他用户共享的情况下,我正在尝试充实 JupyterHub 服务器的工作流程。我想测试这两种方法中的一种。

我正在尝试在公共(public)路径中创建一个环境,然后让另一个用户将 conda 环境添加为内核。到目前为止,它看起来像这样。

# How the environment is created
jupyter@ip:~$ conda create -p /home/envs/test --clone root

# Current setup
nick {~}$ jupyter kernelspec list
Available kernels:
python3 /opt/conda/share/jupyter/kernels/python3
nick {~}$ conda env list
# conda environments:
#
test /home/envs/test
nenv /home/nick/.conda/envs/nenv
base * /opt/conda

nick {~}$ cat .condarc
envs_dirs:
- /home/envs

我的问题是当我尝试安装内核 libstdc++.so.6.0.21 不存在时出现错误。什么是 libstdc++.so.6.0.21

# error when trying to install kernel
nick {~}$ jupyter kernelspec install --user /home/envs/test
[InstallKernelSpec] Removing existing kernelspec in /home/nick/.local/share/jupyter/kernels/test
Traceback (most recent call last):
File "/opt/conda/bin/jupyter-kernelspec", line 11, in <module>
sys.exit(KernelSpecApp.launch_instance())
File "/opt/conda/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/opt/conda/lib/python3.7/site-packages/jupyter_client/kernelspecapp.py", line 273, in start
return self.subapp.start()
File "/opt/conda/lib/python3.7/site-packages/jupyter_client/kernelspecapp.py", line 143, in start
replace=self.replace,
File "/opt/conda/lib/python3.7/site-packages/jupyter_client/kernelspec.py", line 346, in install_kernel_spec
shutil.copytree(source_dir, destination)
File "/opt/conda/lib/python3.7/shutil.py", line 365, in copytree
raise Error(errors)
shutil.Error: [('/home/envs/test/lib/libstdc++.so.6.0.21', '/home/nick/.local/share/jupyter/kernels/test/lib/libstdc++.so.6.0.21', "[Errno 2] No such file or directory: '/home/envs/test/lib/libstdc++.so.6.0.21'")]

备注:I found this question which is similar ;然而,I found through this github thread为什么必须删除 gcc,我已经通过以下方式验证它在我的环境中不存在:

nick {~}$ conda list --name test | grep 'gcc'
_libgcc_mutex 0.1 main
libgcc 7.2.0 h69d50b8_2
libgcc-ng 8.2.0 hdf63c60_1

我已经安装了更高版本的 libgcc,正如您在上面看到的,所以我认为其他答案也不会有太大好处。


文件名显示为红色,所以我认为链接已损坏。

(test) nick {~}$ ls -al /home/envs/test/lib/libstdc++.so.6.0.21
lrwxrwxrwx 1 jupyter jupyter 19 Aug 9 09:42 /home/envs/test/lib/libstdc++.so.6.0.21 -> libstdc++.so.6.0.24

最佳答案

我意识到我正在以一种非预期的方式使用 jupyter kernelspec here .它并不打算实际创建内核,而只是添加一个 kernelspec(如果存在)(see here, at the bottom) .

There are two options for writing a kernel:

  1. You can reuse the IPython kernel machinery to handle the communications, and just describe how to execute your code. This is much simpler if the target language can be driven from Python. See Making simple Python wrapper kernels for details.
  2. You can implement the kernel machinery in your target language. This is more work initially, but the people using your kernel might be more likely to contribute to it if it’s in the language they know.

所以,在我的例子中,我真正想做的是使用 IPython 实用程序(上面的选项 1)which is documented well here.在这种情况下,以用户可以访问的方式将共享的 conda 环境添加为内核,我只需要运行即可。

su - <user>
conda activate test
python -m ipykernel install --user --name test --display-name "Python (test)"

关于jupyter kernelspec 没有这样的文件或目录/lib/libstdc++.so.6.0.21,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57428356/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com