python会搞坏电脑吗,由Python 3.5破坏的Jupyter笔记本

When I updated my Python version from 3.4 to 3.5 (on Mac El Capitan), I reinstalled Jupyter but when I run it and create a new Python 3 notebook, it immediately tells me that there has been a kernel error and if I click on this, then I get this error message:

Traceback (most recent call last): File

"/usr/local/lib/python3.5/site-packages/notebook/base/handlers.py",

line 436, in wrapper

result = yield gen.maybe_future(method(self, *args, **kwargs)) File

"/usr/local/lib/python3.5/site-packages/notebook/services/sessions/handlers.py",

line 56, in post

model = sm.create_session(path=path, kernel_name=kernel_name) File

"/usr/local/lib/python3.5/site-packages/notebook/services/sessions/sessionmanager.py",

line 66, in create_session

kernel_name=kernel_name) File "/usr/local/lib/python3.5/site-packages/notebook/services/kernels/kernelmanager.py",

line 84, in start_kernel

**kwargs) File "/usr/local/lib/python3.5/site-packages/jupyter_client/multikernelmanager.py",

line 109, in start_kernel

km.start_kernel(**kwargs) File "/usr/local/lib/python3.5/site-packages/jupyter_client/manager.py",

line 244, in start_kernel

**kw) File "/usr/local/lib/python3.5/site-packages/jupyter_client/manager.py",

line 190, in _launch_kernel

return launch_kernel(kernel_cmd, **kw) File "/usr/local/lib/python3.5/site-packages/jupyter_client/launcher.py",

line 123, in launch_kernel

proc = Popen(cmd, **kwargs) File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py",

line 950, in __init__

restore_signals, start_new_session) File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py",

line 1540, in _execute_child

raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory:

'/usr/local/opt/python3/bin/python3.4'

I understand that the upgrade from 3.4 to 3.5 meant that packages would be installed in different places, but I can't work out what it is looking for in the Python 3.5 packages when I already ran pip3 install jupyter again (and been uninstalling/reinstalling several times). Does anyone know of a fix for this?

解决方案

There is a leftover kernelspec for IPython pointing to your Python 3.4.

You can see existing kernelspecs with:

jupyter kernelspec list

You can install a new IPython kernelspec with

ipython kernelspec install [--user]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值