我在ubuntu 14.04上。我正在运行anaconda,我使用conda
命令(根据this post)使ipython笔记本中的python 2和python 3都可用。但我刚刚卸载了anaconda并在virtualenv中单独安装了ipython,jupyter和notebook。现在,当我尝试创建一个新笔记本时,我收到以下错误。正如你在最后一行中看到的那样,似乎仍然指的是用anaconda创建的内核,因为我卸载了anaconda后显然不再存在。
有人可以帮我解决这个问题吗?非常感谢。
Traceback (most recent call last):
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/notebook/base/handlers.py", line 458, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/gen.py", line 1008, in run
value = future.result()
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/concurrent.py", line 232, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/gen.py", line 1014, in run
yielded = self.gen.throw(*exc_info)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/notebook/services/sessions/handlers.py", line 58, in post
sm.create_session(path=path, kernel_name=kernel_name))
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/gen.py", line 1008, in run
value = future.result()
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/concurrent.py", line 232, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/gen.py", line 1014, in run
yielded = self.gen.throw(*exc_info)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/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 "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/gen.py", line 1008, in run
value = future.result()
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/concurrent.py", line 232, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/tornado/gen.py", line 282, in wrapper
yielded = next(result)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/notebook/services/kernels/kernelmanager.py", line 87, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/jupyter_client/multikernelmanager.py", line 109, in start_kernel
km.start_kernel(**kwargs)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/jupyter_client/manager.py", line 244, in start_kernel
**kw)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/jupyter_client/manager.py", line 190, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/home/joe/.virtualenvs/crissp/lib/python3.4/site-packages/jupyter_client/launcher.py", line 123, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/joe/anaconda3/envs/py27/bin/python'
答案 0 :(得分:7)
运行jupyter kernelspec list
,它应该告诉你kernelspecs的安装位置。您需要删除现在不正确的文件夹。
或者,按照in the IPython docs所述,使用您现在安装的ipython安装新的kernelspec。这将取代已为该版本的Python安装的kernelspec。