【问题标题】:Fresh Windows 10 install of anaconda and jupyter - Kernel Error (Python 2.7 and 3.5)全新 Windows 10 安装 anaconda 和 jupyter - 内核错误(Python 2.7 和 3.5)
【发布时间】:2016-05-23 15:28:45
【问题描述】:

我使用 ipython 和一点点 jupyter 已经有一段时间了,前段时间。在将近 6 个月没有使用它之后,我想再次开始使用它。

我安装了最新版本的 jupyter,更新了我的 python 2.7 安装,让 pip 工作并安装了必要的软件包:

pip install jupyter
pip install notebook 

等等。完成之后,我尝试进入一个旧笔记本(用 2.7 编写),但没有连接到内核。我想,好吧,为什么不更新到最新的 python 3 版本并尝试一下。这导致了同样的问题。

我继续安装 anaconda 并创建了两个虚拟环境,一个使用 python 2.7,一个使用 python 3.5。两者都是这样安装的:

conda create --name py27 python=2.7 anaconda
conda create --name py35 python=3.5 anaconda

之后,我通过激活它们并尝试安装包来确保两个 venv 都安装了 jupyter。 (这是使用 py27 和 py35 完成的,它们是从上面的命令中看到的 venv 的名称)。

activate py27
conda install jupyter

之后我尝试运行:

jupyter notebook

我创建了一个新的笔记本文件来查看我是否可以访问内核。但是很明显我没有出现以下错误:

Traceback (most recent call last):
  File "E:\Anaconda3\envs\py35\lib\site-packages\notebook\base\handlers.py", line 458, in wrapper
    result = yield gen.maybe_future(method(self, *args, **kwargs))
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\gen.py", line 1008, in run
    value = future.result()
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\gen.py", line 1014, in run
    yielded = self.gen.throw(*exc_info)
  File "E:\Anaconda3\envs\py35\lib\site-packages\notebook\services\sessions\handlers.py", line 58, in post
    sm.create_session(path=path, kernel_name=kernel_name))
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\gen.py", line 1008, in run
    value = future.result()
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\gen.py", line 1014, in run
    yielded = self.gen.throw(*exc_info)
  File "E:\Anaconda3\envs\py35\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 73, in create_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\gen.py", line 1008, in run
    value = future.result()
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\concurrent.py", line 232, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
  File "E:\Anaconda3\envs\py35\lib\site-packages\tornado\gen.py", line 282, in wrapper
    yielded = next(result)
  File "E:\Anaconda3\envs\py35\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 87, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "E:\Anaconda3\envs\py35\lib\site-packages\jupyter_client\multikernelmanager.py", line 109, in start_kernel
    km.start_kernel(**kwargs)
  File "E:\Anaconda3\envs\py35\lib\site-packages\jupyter_client\manager.py", line 244, in start_kernel**kw)
  File "E:\Anaconda3\envs\py35\lib\site-packages\jupyter_client\manager.py", line 190, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "E:\Anaconda3\envs\py35\lib\site-packages\jupyter_client\launcher.py", line 108, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "E:\Anaconda3\envs\py35\lib\subprocess.py", line 950, in __init__ restore_signals, start_new_session)
  File "E:\Anaconda3\envs\py35\lib\subprocess.py", line 1220, in _execute_child startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

这显然是在我的 py35 venv 上尝试过的,但是我在 py27 venv 上遇到了同样的错误。我尝试了一些方法,例如运行 kernelspec,但都没有成功。

有人对可能出了什么问题提出了建议?

【问题讨论】:

标签: python-2.7 windows-10 jupyter python-3.5 jupyter-notebook


【解决方案1】:

我遇到了同样的问题。您需要为 jupyter notebook 创建一个 kernelspec。点此链接即可解决。

How to start an ipython shell(not notebook) within a conda or virtualenv

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 1970-01-01
    • 2021-12-25
    • 2016-05-25
    • 2017-09-29
    • 1970-01-01
    相关资源
    最近更新 更多