gpt4 book ai didi

python-3.x - Anaconda 2019.03 for Python 3.7 on macOS 上的 Jupyter Notebook 内核错误

转载 作者:行者123 更新时间:2023-12-03 11:21:34 24 4
gpt4 key购买 nike

我刚刚使用 Python 3.7 安装了适用于 macOS 的 Anaconda 2019.03,并希望将其用于 Jupyter Notebook 的 Python 3 编程。当我运行 Jupyter Notebook 时,由于内核错误而无法运行。

我在重新安装之前卸载了 Anaconda for Python 2.7 和 Python 3.7(我卸载并重新安装是因为一个单独的问题),我认为当我手动卸载 Anaconda 时一些重要的内核文件可能已经被删除。我认为下面的错误消息显示 Anaconda 是从根目录 (/) 中名为 anaconda3 的文件夹启动的,但在错误消息的最后一行,它似乎是在我的主文件夹 (myhomefolder) 中查找内容。我不太确定如何解释这一点,因为我对此还很陌生。

Traceback (most recent call last):
File "/anaconda3/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/anaconda3/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/anaconda3/lib/python3.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 "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/anaconda3/lib/python3.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 "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper
yielded = next(result)
File "/anaconda3/lib/python3.7/site-packages/notebook/services/kernels/kernelmanager.py", line 160, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/anaconda3/lib/python3.7/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/anaconda3/lib/python3.7/site-packages/jupyter_client/manager.py", line 259, in start_kernel
**kw)
File "/anaconda3/lib/python3.7/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/anaconda3/lib/python3.7/site-packages/jupyter_client/launcher.py", line 138, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/anaconda3/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/anaconda3/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/myhomefolder/anaconda/envs/ipykernel_py3/bin/python': '/Users/myhomefolder/anaconda/envs/ipykernel_py3/bin/python'

最佳答案

解决方案是在终端中运行以下命令:

python -m ipykernel install --user,

我相信它会安装内核。我在以下 GitHub 帖子中找到了解决方案,launching jupyter i get kernel error #2301 .

我不知道这是否是最完整的解决方案,可以避免将来出现类似问题,但目前看来是可行的。当然,如果有人有其他建议,我很乐意听取。

关于python-3.x - Anaconda 2019.03 for Python 3.7 on macOS 上的 Jupyter Notebook 内核错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56487222/

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