Reputation: 13
I am attempting to import Beautiful Soup4-4.1.0 into Python 3.3 (I have placed Beautiful Soup in: C:\Python33\Lib\site-packages\BeautifulSoup\bs4
).
Using the following:
from BeautifulSoup import bs4
I receive the following error:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
from BeautifulSoup import bs4
File "C:\Python33\lib\site-packages\BeautifulSoup\bs4\__init__.py", line 175
except Exception, e:
Can anyone help with this?
Upvotes: 1
Views: 987
Reputation: 23449
I recommend you read the BeautifulSoup documentation because and I cite :
Beautiful Soup 4 works on both Python 2 (2.6+) and Python 3.
In any case BeautifulSoup 4 is published through PyPi, so if you can’t install it with the system packager, you can install it with easy_install or pip. The package name is beautifulsoup4, and the same package works on Python 2 and Python 3.
$ easy_install beautifulsoup4
$ pip install beautifulsoup4
If you don't have easy_install or pip installed, you can download the BeautifulSoup 4 source tarball and install it with setup.py. [Go to that folder and run command setup.py install (assuming *.py is known in path extensions, otherwise run
c:\pythonXX\python setup.py install).
Upvotes: 1