安装 jupyter-notebook 后 Spyder3 崩溃

Spyder3 crash, after install jupyter-notebook

在安装jupyter-notebook之前,我在笔记本电脑上使用Spyder3没有任何问题。

当从命令行 运行 spyder3 时,出现下一条消息:

文件“/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py”,第 70 行,在 class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):

AttributeError: 'module' 对象没有属性 '_base'

经过一番搜索后,尝试建议的解决方案:

https://github.com/spyder-ide/spyder/issues/4309

https://bugs.launchpad.net/beautifulsoup/+bug/1603299

尝试:

sudo pip install --upgrade beautifulsoup4

sudo pip install --upgrade html5lib

sudo pip install spry

同时重新安装:

sudo pip install --upgrade spyder

一年前我在台式机上遇到了同样的问题, 我修改了一些 python 代码,但现在不记得是如何修改的了。

同时将 html5lib 版本降级到与我的台式机相同的版本:

sudo -H pip install html5lib==0.9999999

和beautifulsoup4

sudo -H pip install beautifulsoup4==4.4.1


python

import html5lib

html5lib.version

u'0.9999999'

import bs4

bs4.version

'4.4.1'


但什么也没发生。

笔记本机已安装:

Ubuntu 16.04 - 32 位 python 2.7、3 和 3.5

欢迎任何帮助

使用 ubuntu 包管理器安装 spyder3 后,我遇到了类似的问题:spyder 因“AttributeError: 'module' object has no attribute '_base' 而崩溃 可以修复它: pip install --user --upgrade spyder 我想,'--user' 选项是编写模块正确路径的解决方案。

我在这里找到了解决方案:https://github.com/Sigil-Ebook/Sigil/issues/316

打开文件:sudo mousepad /usr/lib/python3/dist-packages/bs4/builder/_html5lib.py

并更改:

class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):

class TreeBuilderForHtml5lib(html5lib.treebuilders.base.TreeBuilder):

class 元素(html5lib.treebuilders._base.Node):

class 元素(html5lib.treebuilders.base.Node):