一、Mac安裝BeautifulSoup4出現(xiàn)的問(wèn)題
直接在終端用pip安裝時(shí)我總是出現(xiàn)
Could not find a version that satisfies the requirement beautilfulsoup4 (from versions: )
No matching distribution found for beautilfulsoup4
這樣的錯(cuò)誤,查詢時(shí)發(fā)現(xiàn)需要去python官網(wǎng)下載bs4的安裝包,再進(jìn)行一系列的查找安裝 很麻煩。
之后我試了一下命令:
sudo easy_install beautifulsoup4
執(zhí)行后發(fā)現(xiàn)安裝成功啦
二、pycharm下通過(guò)提示BeautifulSoup導(dǎo)入失敗解決方式
之前是通過(guò)IDEA提示導(dǎo)包的,這次卻發(fā)現(xiàn)BeautifulSoup導(dǎo)不成功,并提示
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int "Unit tests have failed!...
查詢后發(fā)現(xiàn)都是通過(guò)setting來(lái)解決的,而Mac的pycharm沒(méi)有setting。。。
但是在pycharm的preferences中我找到了Project Interpreter~如下圖所示:

點(diǎn)擊圖中的紅圈圈“+”,輸入Beautifulsoup ,就可以找到你要安裝的插件啦。
注意:Python2的選擇BeautifulSoup進(jìn)行安裝,Python3的選擇bs4進(jìn)行安裝。