我在我的ubuntu 10.04上运行python 3.1.2
我需要安装哪个版本的BeautifulSoup以及如何安装?
我已经下载了3.2版并运行sudo python3 setup.py install
但不起作用
日Thnx
编辑:我得到的错误是:
>>> import BeautifulSoup
Traceback (most recent call last):
File "", line 1, in
File "BeautifulSoup.py", line 448
raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr)
^
SyntaxError: invalid syntax
>>>
解决方法:
与Python 3一起使用的唯一系列的BeautifulSoup是3.1但是作者放弃了它并且不会发布更新.您可以阅读有关问题here的更多信息.
更新:这不再是真的,BeautifulSoup 4适用于Python 3.您可以使用pip install beautifulsoup4安装它.
pip install BeautifulSoup将安装版本3.
标签:python,beautifulsoup
来源: https://codeday.me/bug/20191002/1841934.html