学无先后,达者为师

网站首页 编程语言 正文

解决Jupyter Notebook “signal only works in main thread“问题_python

作者:loovelj   更新时间: 2023-02-10 编程语言

Jupyter Notebook “signal only works in main thread“

1、今天在使用Jupyter Notebook的时候

看到Jupyter可以更换主题,很简单,使用pip 安装jupyter-themes 就可以了

# install jupyterthemes
pip install jupyterthemes

# upgrade to latest version
pip install --upgrade jupyterthemes

2、但是在安装是时候

会说jupyter core 版本比较低,安装不成功,查询了一下,可以使用conda升级jupyter

#升级jupyter
conda upgrade notebook

3、安装完成后

重新安装jupyterthemes就成功了。

#设置主题
jt -t chesterish

现在启动就可以看到彩色的主题了。

4、但是又会出现这个问题

就是内核一直显示忙碌,连简单的print都不能执行了。

然后看后台,最后说"signal only works in main thread"

5、查询了很多网站

最后发现是两个包版本安装不对,重新安装这两个包就就可以了。

pip install "pyzmq==17.0.0" "ipykernel==4.8.2"

安装成功后,启动jupyter,发现可以正常运行了。

===========================

9012年了,这些都有了很大的改变,我看现在pip 自动安装最新的版本是下面这个,大家试试可以不,不行就用上面的吧

pip install "ipython-7.23.1" "pyzmq-22.0.3"

总结

原文链接:https://blog.csdn.net/loovelj/article/details/82184223

栏目分类
最近更新