Today is a terrible day for me. I'm so frustrated because I've spent the last 4 hours trying to install beautifulsoup4. I've searched every tutorial I can get my hands on.
It is installed on my computer, but when I do import bs4 on the shell it gives me this message:
Traceback (most recent call last):
File "", line 1, in
import bs4
File "C:\Python34\lib\bs4\__init__.py", line 48
'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).'
Does anyone have any idea what I can do? it tells me to run a command but it doesn't tell me how to run it.
解决方案
The answer is in the question. In the folder where bs4 is located (you could download bs4 in you work folder also), run :
2to3 -w bs4