用 conda 安装 jupyter-themes: 修改 ju

2019-03-19  本文已影响0人  额_1524

安装方法

依赖不匹配怎么解决

若jupyter notebook是conda安装,却用安装pip安装jupyterthemes,会出现多种依赖不匹配,最终如下装一圈依赖,才能安装成功

conda upgrade notebook libsodium
pip install jupyterthemes
pip install --upgrade --user nbconvert
pip install --upgrade ipykernel

以下是各个依赖不匹配的详解:

Found existing installation: terminado 0.6

执行pip install jupyterthemes时报错

notebook 5.7.6 has requirement jupyter-core>=4.4.0, but you'll have jupyter-core 4.3.0 which is incompatible.

Installing collected packages: lesscpy, terminado, pyzmq, jupyter-client, prometheus-client, Send2Trash, notebook, jupyterthemes
Found existing installation: terminado 0.6
Cannot uninstall 'terminado'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

这是因为,上述操作中pip自动更新了notebook,但这个notebook是用conda而非pip装的,故依赖项terminado不对

解决方法:

conda upgrade notebook

而后可正常安装

pip install jupyterthemes

ImportError: libsodium.so.23

执行jupyter notebook,报错

ImportError: libsodium.so.23: cannot open shared object file: No such file or directory

这是由于jupyterthemes依赖的libsodium没有更新

解决办法:

conda update libsodium
# 或
conda install -c conda-forge libsodium

ModuleNotFoundError: No module named 'nbconvert.exporters.base'

运行notebook时,用浏览器成功打开notebook的目录网页,但无法打开/新建python3 的 notebook文件,命令行下报错

ModuleNotFoundError: No module named 'nbconvert.exporters.base'

[E 20:28:58.544 NotebookApp]

这是因为,这是由于jupyterthemes依赖的nbconvert没有更新

解决办法:

pip install --upgrade --user nbconvert

然后将$USER/.local/bin添加到PATH,即可实现上述运行

ERROR:tornado.general: Uncaught exception in zmqstream callback

运行notebook时,用浏览器成功打开notebook的目录网页,能成功打开/新建python3 的 notebook文件,但点运行,迟迟不运行,命令行下报错

ERROR:tornado.general: Uncaught exception in zmqstream callback

这是因为,这是由于jupyterthemes依赖的ipykernel没有更新

解决办法:

pip install --upgrade ipykernel

参考

https://github.com/dunovank/jupyter-themes

【内容引起舒适】让你的Jupyter Notebook不再辣眼睛

上一篇下一篇

猜你喜欢

热点阅读