想写个爬虫脚本,安装beautifulsoup的时候一直出错,报错信息是
SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(“Unit tests have failed!”)?
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-hj0pe17y/beautifulsoup/
自己尝试pip换成pip3,国内源换成官方源,都没成功,百度前几个帖子看了也是不成功,最后多翻了翻,还是找到了解决办法。
beautifulsoup 在bs4安装包中,py3直接安装beautifulsoup会出错,所以安装bs4就行了。
pip install bs4
本文解决在Python3环境下安装BeautifulSoup遇到的SyntaxError问题,详细介绍了错误原因及正确安装方法,即通过安装bs4包来替代。
350

被折叠的 条评论
为什么被折叠?



