问题描述
我正在尝试为python33安装beautifulsoup但它没有正确安装它给出了错误:
C:\Python33>pip install beautifulsoup
Downloading/unpacking beautifulsoup
Downloading BeautifulSoup-3.2.1.tar.gz
Running setup.py egg_info for package beautifulsoup
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\windows\temp\pip_build_Prashant\beautifulsoup\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\windows\temp\pip_build_Prashant\beautifulsoup\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: invalid syntax
那么我能为这个错误做些什么,有人能建议我吗?
1楼
您正在尝试安装BeautifulSoup 3,它不兼容Python 3。 安装代替:
pip install beautifulsoup4
大多数假设BeautifulSoup 3的代码也适用于BeautifulSoup 4.对于新项目,只需坚持使用BS4。