anaconda+pycharm安装beautifulsoup4报错“No module named 'beautifulsoup4'”或者“No module named bs4”的解决办法

win10系统安装anaconda3后,自动安装了beautifulsoup4包,但是当在pycharm中输入import beautifulsoup4时,一直出现ModuleNotFoundError: No module named 'beautifulsoup4',看了很多博客,很多人在pycharm的setting里面的project interpreter找到bs4,点击install package就解决问题了。

但,,我的pycharm里面并没有bs4,只有beautifulsoup4,因此我点击install package在pycharm里安装了beautifulsoup4,显示安装成功,但运行结果仍然报错。

紧接着,我怀疑是我没有安装bs4导致,所以在终端用pip安装了bs4,但是pycharm里面并没有显示bs4,运行import beautifulsoup4依旧报错。

再后来怀疑是anaconda3安装的beautifulsoup4和pycharm的beautifulsoup4冲突了?所以就用conda remove beautifulsoup4删除了 beautifulsoup4包。然后在pycharm的setting中重新找到 beautifulsoup4,点击install package,再次运行,终于不报错了,而且终端输入conda list  也显示安装了beautifulsoup4。

 

猜你喜欢

转载自blog.csdn.net/LivLu24/article/details/93232457