2016-03-29 42 views
1

während Notebook mit dem Code mit jupyter'BeautifulSoup' hat kein Attribut '__version__'

from bs4 import BeautifulSoup 
print ("BeautifulSoup version:%6.6s" %BeautifulSoup.__version__) 

bekam ich diesen Fehler

AttributeError: type object 'BeautifulSoup' has no attribute 'version'

Ich installierte BS4 mit Python setup.py installieren. Es zeigte in der Installation "c: \ Benutzer ... \ anaconda3 \ lib \ site-packages \ beautifulsoup4-4.4.1-py3.5.egg"

Antwort

5

Für BeautifulSoup Version 4, sollten Sie diesen Weg getan haben stattdessen:

>>> import bs4 
>>> print ("BeautifulSoup version:%6.6s" % bs4.__version__) 
BeautifulSoup version: 4.4.1 
+0

Danke für die Hilfe !!! – Raf8

Verwandte Themen