處理bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. 問題

編譯器:pycharm
python版本:3.7.1
lxml版本:4.2.5
場景描述:BeautifulSoup在解析時用lxml解析器運行下列代碼會報錯
處理bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. 問題

報錯如下:
處理bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. 問題
經歷了去網上查找辦法:
1.把soup=BeautifulSoup(markup,‘lxml’)中的解析器“lxml”換成python的標準庫“html.parser”,即
soup=BeautifulSoup(markup,‘html.parser’) 也行,但沒解决lxml库不能用的问题,棄!
2.還有個方法,太複雜了窮盡腦力的時候再試,具體地址:http://www.jb51.net/article/67125.htm
3.卸載當前lxml版本安裝3.7.0版本,運行卒!
4.突然想到要驗證是不是lxml或pycharm的問題,直接在cmd中運行同樣代碼不就好了
然後就過了!!!
處理bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. 問題
不用想了,肯定是pycharm的問題了。然後當然第一步是缺什麼補什麼,找到file——>setting先安裝lxml
處理bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. 問題
完了再次顫抖著運行…過了,我那個仰天長笑啊
處理bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. 問題
菜鳥新手,不知道對不對…手動狗頭保命【dog】