Jupyter Notebook代碼補全插件nbextensions安裝錯誤問題

安裝過程 (cmd環(huán)境)

1.install jupyter_contrib_nbextensions

  pip install --user jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
  jupyter contrib nbextension install --user

因為默認地址下載速度超慢,所以使用-i https://pypi.mirrors.ustc.edu.cn/simple啟用了一個鏡像地址,

2.install jupyter_nbextensions_configurator

 pip install --user jupyter_nbextensions_configurator 
 jupyter nbextensions_configurator enable --user

如果按照上述步驟安裝成功,那么恭喜你運氣不錯。

3.安裝失敗問題

有時在輸入第二條指令jupyter contrib nbextension install --user會報錯

Error executing Jupyter command 'contrib': [Errno 'jupyter-contrib' not found] 2

網(wǎng)友對此問題第一種解決方法是更改第二條指令為:

jupyter contrib-nbextension install --user 

網(wǎng)友對此問題第二種解決方法是更改第二條指令為conda指令(如果你用的是Anaconda的話)

conda install -c conda-forge jupyter_contrib_nbextensions

如果運氣好點,問題到此就可以解決了,但是世界上最不缺的就是倒霉蛋,在解析了十幾分鐘后,喜提 CondaHTTPError錯誤。
對錯誤問題進行排查

3.1.是否是conda指令網(wǎng)絡(luò)連接不暢?

conda update conda

發(fā)現(xiàn)更新conda成功,并不是該問題

3.2是否是包安裝失敗或未安裝?

pip list

發(fā)現(xiàn) jupyter_contrib_nbextensions 包已經(jīng)在pip的包目錄中。
因為我使用的python的發(fā)行版'Anaconda',Anaconda推薦使用conda管理包,雖然也可以使用pip管理包。所以需要檢查一下conda的包目錄。

conda list

發(fā)現(xiàn) jupyter_contrib_nbextensions 包并不在conda的包目錄中
很尷尬的局面,pip說我已經(jīng)安裝好了,conda說我沒有。但conda才是Anaconda親兒子啊。conda說沒有那就沒有。
所以更改指令pip install --user jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple為`:

conda install --user jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple

總結(jié)

計算機環(huán)境:Annaconda(python3.7)、win10
安裝成功使用是下面四條指令

1.  conda install --user jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
2.  jupyter contrib nbextension install --user
3.  pip install --user jupyter_nbextensions_configurator 
4.  jupyter nbextensions_configurator enable --user

希望我踩過的坑對你有所幫助->->love&peace

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容