安裝過程 (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
因?yàn)槟J(rèn)地址下載速度超慢,所以使用-i https://pypi.mirrors.ustc.edu.cn/simple啟用了一個(gè)鏡像地址,
2.install jupyter_nbextensions_configurator
pip install --user jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
如果按照上述步驟安裝成功,那么恭喜你運(yùn)氣不錯(cuò)。
3.安裝失敗問題
有時(shí)在輸入第二條指令jupyter contrib nbextension install --user會(huì)報(bào)錯(cuò)
Error executing Jupyter command 'contrib': [Errno 'jupyter-contrib' not found] 2
網(wǎng)友對(duì)此問題第一種解決方法是更改第二條指令為:
jupyter contrib-nbextension install --user
網(wǎng)友對(duì)此問題第二種解決方法是更改第二條指令為conda指令(如果你用的是Anaconda的話)
conda install -c conda-forge jupyter_contrib_nbextensions
如果運(yùn)氣好點(diǎn),問題到此就可以解決了,但是世界上最不缺的就是倒霉蛋,在解析了十幾分鐘后,喜提 CondaHTTPError錯(cuò)誤。
對(duì)錯(cuò)誤問題進(jìn)行排查
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的包目錄中。
因?yàn)槲沂褂玫膒ython的發(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é)
計(jì)算機(jī)環(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
希望我踩過的坑對(duì)你有所幫助->->love&peace