user2232395
user2232395

Reputation: 491

Spyder3 crash, after install jupyter-notebook

In the notebook machine I was using Spyder3 without any problem until install jupyter-notebook.

When run spyder3 from command line, the next message appear:

File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):

AttributeError: 'module' object has no attribute '_base'

after some search try the proposed solutions on:

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

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

beautifulsoup, html5lib: module object has no attribute _base

try:

sudo pip install --upgrade beautifulsoup4

sudo pip install --upgrade html5lib

sudo pip install spry

Also reinstall:

sudo pip install --upgrade spyder

One year ago in the desktop machine i had the same problem, i fixed changing some python code but now dont remember how was fixed it.

Also downgrade the html5lib version to the same version of my desktop computer:

sudo -H pip install html5lib==0.9999999

and beautifulsoup4

sudo -H pip install beautifulsoup4==4.4.1


python

import html5lib

html5lib.version

u'0.9999999'

import bs4

bs4.version

'4.4.1'


But nothing happen.

The notebook machine have installed:

Ubuntu 16.04 - 32 bit python 2.7, 3 and 3.5

Any help will be welcome

Upvotes: 1

Views: 371

Answers (2)

user2232395
user2232395

Reputation: 491

I found the solution here: https://github.com/Sigil-Ebook/Sigil/issues/316

open the file: sudo mousepad /usr/lib/python3/dist-packages/bs4/builder/_html5lib.py

and change :

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

with

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

and

class Element(html5lib.treebuilders._base.Node):

with

class Element(html5lib.treebuilders.base.Node):

Upvotes: 2

Ma4833
Ma4833

Reputation: 1

I had a similar problem after the installation of spyder3 using the ubuntu package manager: spyder was crashing with 'AttributeError: 'module' object has no attribute '_base' Could fix it with: pip install --user --upgrade spyder I guess, the '--user' option is the solution to write the right paths of the modules.

Upvotes: 0

Related Questions