Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'BeautifulSoup' has no attribute '__version__'

while using jupyter notebook using the code

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

I got this error

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

I installed bs4 using python setup.py install. It showed in the installation " c:\users...\anaconda3\lib\site-packages\beautifulsoup4-4.4.1-py3.5.egg "

like image 933
Raf8 Avatar asked May 30 '26 19:05

Raf8


1 Answers

For BeautifulSoup version 4, you should've done this way instead :

>>> import bs4
>>> print ("BeautifulSoup version:%6.6s" % bs4.__version__)
BeautifulSoup version: 4.4.1
like image 171
har07 Avatar answered Jun 02 '26 09:06

har07



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!