jupyter notebook kernel error

2021-02-21 要努力的小正

    今天打開jupyter notebook 出現kernel error的問題。

問題如下面這幅圖:

辦法一:(回答來源於知乎)

     今天安裝了 Anaconda 後,打開 Jupyter notebook 之後,出現了 kernel error 錯誤(如下圖),找遍了網上的許多方法,各種複雜的方法都試過,都沒有成功,最後的解決辦法竟然是 :以管理員的身份運行,就解決了。此時心裡。。。。。

  看著人家都評論成功了,我的依舊不好使。難搞的很。

辦法二:(感覺靠譜)

1. 打開cmd或者Anaconda Prompt (Anaconda3)。先運行下行⬇️代碼,看電腦中的kernel路徑,

jupyter kernelspec list

比如:

python2 /usr/local/share/jupyter/kernels/python2

pytorch37 /usr/local/share/jupyter/kernels/pytorch37

pytorch3_6 /usr/local/share/jupyter/kernels/pytorch3_6

2. 運行下行代碼,刪掉不用的kernel

比如:

rm -r /usr/local/share/jupyter/kernels/python2

按以上方式刪掉其他不用的kernel。

(打擾一下,win10系統沒有rm -r指令,所以怎麼辦呢,直接複製上面的路逕到文件路徑中,點擊回車就可以打開此路徑了,刪除這個文件夾。前提是關閉jupyter  notebook)

   之後再打開jupyter  notebook,會發現神奇的一幕出現了,它好使了。萬事大吉。下面的這個步驟我沒有操作,是因為我之前重新安裝了jupyter  notebook。他出現的這個錯誤。我安裝前兩個步驟的辦法已經給搞定了,

3. 安裝正確的kernel

python -m ipykernel install --user

完畢!!!!!!!!

點讚👇👇👇👇👇在看

相關焦點

  • jupyter notebook配置IRkernel(mac版)
    windows下jupyter notebook配置IRkernel見:玩轉Jupyter Notebook5-配置python|R|Julia|Stata前提是R已經安裝完畢第一步在「R」has to be installed but 「jupyter kernelspec --version」 exited with code 127.
  • 安裝Jupyter Notebook
    創建Jupyter默認配置文件(test_envs) [root@iZuf60a8w2ct7p4wqkf5c3Z test]# jupyter notebook --generate-configWriting default config to: /root/.jupyter/jupyter_notebook_config.py
  • Jupyter Notebook基本使用
    幸運的是jupyter notebook也在其中,這樣我們就可以直接開箱即用了。notebook基本使用打開jupyter notebook,在cmd或者powershell中輸入jupyter-notebook.exe應用啟動後,本質上是在後臺跑一個web服務jupyter notebook執行上面命令之後
  • 快速入門 Jupyter notebook
    運行 Jupyter在 Windows,可以通過添加到開始菜單的快捷方式運行 Jupyter ,當然也可以通過在命令行輸入命令 jupyter notebook 開始運行,然後會在默認瀏覽器中打開一個新的窗口,窗口內容如下:
  • Anaconda+Jupyter notebook+虛擬環境配置
    jupyter notebook --generate-configdeactivate datascience#取消激活當前環境conda env list#顯示當前系統所有虛擬環境conda env remove -n datascience#刪除虛擬環境python –m ipykernel install --user --name=datascience#設置jupyter notebook中內核顯示的名字Jupyter notebook#啟動jupyter
  • 在jupyter notebook中同時安裝python2和python3
    由於我之前使用的jupyter notebook是基於python3.5版本的,所以只要在此基礎上安裝基於python2.7的內核即可。我的環境如下:windows 7, 64位系統已安裝基於python3.5版本的anaconda已在anaconda中安裝py27和py36的虛擬環境已有的jupyter notebook的kernel是基於python3.5版本的在py35的kernel基礎上安裝py27的kernel在jupyter notebook
  • Jupyter notebook使用技巧大全
    jupyter notebook 同樣,執行pip install jupyter即可完成安裝。Jupyter Notebook入門啟動在終端中輸入jupyter notebook是最常用的啟動方式,默認在本地的8888埠啟動。如果本地已經有一個jupyter正在運行,再啟動一個就會運行在8889埠。
  • Jupyter notebook使用指南
    Jupyter相對於其他python編程工具來說,除了通常的新建、刪除、更改、下載編程文件外,還支持在線編程運算可幫助持續開發,特別在企業中有些項目需要持續很長時間的開發,每天下班後關閉jupyter,只要伺服器的kernel不關閉,jupyter會保存好開發時的數據緩存和可視化結果,第二天繼續開發,而不用又從頭再運行,再配合支持markdown的功能,使得jupyternotebook
  • 在Jupyter Notebook中使用MicroPython從瀏覽器控制電子設備
    jupyter-client>=5.3.4->notebook->jupyter) (2.8.1)Collecting ptyprocess; os_name !我們可以使用以下代碼從Jupyter MicroPython Kernel GitHub存儲庫中獲取它:~$ git clone https://github.com/goatchurchprime/jupyter_micropython_kernel.gitCloning into 'jupyter_micropython_kernel'...
  • 新編輯神器,可以在終端運行 Jupyter Notebook 了!
    [default: ]Options:  --no-kernel                     Don't launch a kernel.  --run                           Run the notebook.
  • 史上最詳細的Jupyter Notebook入門教程
    啟動程序為jupyter-notebook。可以進入命令行,然後使用 jupyter-notebook --h 來查看使用說明。(c:\soft\py3) C:\Users\wangwei01>jupyter notebook --husage: jupyter-notebook [-h] [--pylab [NOTEBOOKAPP.PYLAB]]                        [--keyfile NOTEBOOKAPP.KEYFILE]
  • Jupyter Notebook與Livy集成
    cd /data/disk1/cloudera/anaconda3/lib/python3.6/site-packages/opt/cloudera/anaconda3/bin/jupyter-kernelspec
  • Python編程神器Jupyter Notebook使用的28個秘訣
    18.在markdown cell 中書寫LaTeX時,它會被 MathJax 渲染成一個公式19.在一個notebook中運行多種kernel的代碼如果想要的話,你可以在一個notebook中運行多種kernel的代碼在每個cell的開頭使用相關的魔法命令來聲明你想使用的 kernel。
  • 27 Jupyter Notebook tips, tricks and shortcuts
    %envYou can manage environment variables of your notebook without restarting the jupyter server process.
  • Python從入門到大師教程 | 二、搭建Jupyter Notebook環境
    4、虛擬環境搭建在創建的虛擬環境上運行jupyter notebook,但發現在notebook中的python其實並沒有運行在指定的虛擬環境引擎上,只需要安裝nb_conda_kernels插件即可解決,注意是在base環境下安裝,而不是虛擬環境(base) conda install nb_conda_kernels安裝成功後,在kernel -> change kernel中即可切換到指定的虛擬環境
  • Python編程神器Jupyter Notebook使用的28個秘訣(附代碼)
    pip list | grep pandas在markdown cell 中書寫LaTeX時,它會被 MathJax 渲染成一個公式19 在一個notebook中運行多種kernel的代碼如果想要的話,你可以在一個notebook中運行多種kernel的代碼。在每個cell的開頭使用相關的魔法命令來聲明你想使用的 kernel。
  • macOS升級後Jupyter Notebook報錯解決
    升級到了10.12.5後,像往常一樣執行:jupyter notebook結果突然報錯,嚇了我一跳:0:97: execution error: 「"http://localhost:8889/tree?
  • Jupyter Notebook 的 28 個技巧(下)
    這個:$P(A \mid B) = \frac{P(B \mid A)P(A)}{P(B)}$將會變成這個:jupyter-notebook-latexMarkdown控制臺並運行下面的命令:install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))devtools::install_github('IRkernel/IRkernel')IRkernel::installspec() # to register the kernel
  • 系統圖解Jupyter Notebook
    以上三種方法會在家目錄下打開jupyter notebook HOME頁,結果如下。2、修改Jupyter Notebook打開路徑默認在家目錄下打開jupyter notebook,其實我們可以自己設置在想要的位置打開jupyter notebook,以下兩種方法均可。
  • 致Python初學者:你必須會的Jupyter Notebook
    支持多語言,也許你習慣使用 R 語言來做數據分析,或者是想用學術界常用的 MATLAB 和 Mathematica,這些都不成問題,只要安裝相對應的核(kernel)即可。這裡列出了 Jupyter 支持的所有語言,供您參考。