平常都是通过IDEA提示导包的,这次却发现BeautifulSoup导不成功,并提示
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int "Unit tests have failed!...
上网搜索尝试一番,都是不符合的,最终发现,在 项目包 管理界面导入才生效,以下是过程:
File --> Settings(ctrl+alt+s) ->Project:(项目名) -> Project Interpreter。如下图所示:
![pycharm下通过提示BeautifulSoup导入失败解决方式 pycharm下通过提示BeautifulSoup导入失败解决方式](https://image.shishitao.com:8440/aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzk0Ni9lMWFiMzgwYWMyMmI3MmVlNGY2ZjI3MmFjZDlhZmRmMi5wbmc%3D.png?w=700&webp=1)
点击“+”,输入Beautifulsoup ,就可以找到你要安装的插件了。
注意:Python2的选择BeautifulSoup进行安装,Python3的选择bs4进行安装。