当我点击Spyder 2.7的图标时,图标会出现在启动器上并很快消失。我安装使用在终端中,当键入spyder时,它会出现此错误:
Traceback (most recent call last):
File "/usr/bin/spyder", line 3, in <module>
start_app.main()
File "/usr/lib/python2.7/dist-packages/spyderlib/start_app.py", line 114, in main
from spyderlib import spyder
File "/usr/lib/python2.7/dist-packages/spyderlib/spyder.py", line 155, in <module>
from spyderlib.utils.environ import WinUserEnvDialog
File "/usr/lib/python2.7/dist-packages/spyderlib/utils/environ.py", line 17, in <module>
from spyderlib.widgets.dicteditor import DictEditor
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/dicteditor.py", line 39, in <module>
from spyderlib.widgets.dicteditorutils import (sort_against, get_size,
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/dicteditorutils.py", line 78, in <module>
import bs4
File "/usr/lib/python2.7/dist-packages/bs4/__init__.py", line 30, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/usr/lib/python2.7/dist-packages/bs4/builder/__init__.py", line 314, in <module>
from . import _html5lib
File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in <module>
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'
我尝试将html5lib和beautifulsoup更新为所需版本,但没有帮助。我该如何解决这个问题?
答案 0 :(得分:0)
如果升级无效,请尝试降级到pip install --upgrade html5lib==1.0b8
。
答案 1 :(得分:0)
( Spyder维护者)错误中的这一行
/usr/lib/python2.7/dist-packages/spyderlib/start_app.py
表示您使用非常非常旧Spyder版本( 2.3 ,三年前发布)。
我们建议获取最新版本( 3.2.8 )是下载并安装Anaconda,而不是使用Linux发行版中的软件包(这可能是过时的,如同在这种情况下)。