问题
当在你的jupyter notebook中输入代码,不变色,没反应,print(‘hello’)都毫无动静的时候,看一下代码右上角有没有一个红色的kernel error,点开之后发现有这种提示:
Traceback (most recent call last):
File “F:\Python\Python38…\service.py”, line 74, in start
stdout=self.log_file, stderr=self.log_file)
File “F:\Python\Python38…\subprocess.py”, line 707, in init
restore_signals, start_new_session)
File “F:\Python\Python38…\subprocess.py”, line 1034, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
***FileNotFoundError: [WinError 2] 系统找不到指定的文件
原因
或者由于多次卸载安装anaconda或python,导致python的kernel内核安装路径混乱,使得Jupyter notebook不可用
解决
很多博客我看到说要在Anaconda Prompt输入jupyter kernelspec list检查安装的内核和位置,但我检查完了发现不对了也不会改…搞得一堆路径乱七八糟的不如暴力重装
在Anaconda Prompt输入:
python -m ipykernel install --user
重启检查okk