Mac安装BeautifulSoup4出现的问题与pycharm下通过提示BeautifulSoup导入失败解决方式

一、Mac安装BeautifulSoup4出现的问题

直接在终端用pip安装时我总是出现
Could not find a version that satisfies the requirement beautilfulsoup4 (from versions: )
No matching distribution found for beautilfulsoup4
这样的错误,查询时发现需要去python官网下载bs4的安装包,再进行一系列的查找安装 很麻烦。

之后我试了一下命令:

sudo easy_install beautifulsoup4

执行后发现安装成功啦

二、pycharm下通过提示BeautifulSoup导入失败解决方式

之前是通过IDEA提示导包的,这次却发现BeautifulSoup导不成功,并提示
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int "Unit tests have failed!...

查询后发现都是通过setting来解决的,而Mac的pycharm没有setting。。。

但是在pycharm的preferences中我找到了Project Interpreter~如下图所示:

Project Interpreter

点击图中的红圈圈“+”,输入Beautifulsoup ,就可以找到你要安装的插件啦。

注意:Python2的选择BeautifulSoup进行安装,Python3的选择bs4进行安装。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容