python bs4解析网页时 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to inst
来源:互联网 发布:skype点数淘宝充值 编辑:程序博客网 时间:2024/06/04 00:30
Python小白,学习时候用到bs4解析网站,报错
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
几经周折才知道是bs4调用了python自带的html解析器,我用的mac,默认安装的是python2,所以内置的解释器也是捆绑在python2上,而我学习的时候又自己安装了python3,开发环境也是python3的,貌似是没有html解释器,所以会报错。
问题找到了,那么怎么解决呢?对,在python3也装一个html解析器就好了,那么怎么安装呢?查阅资料获悉:一般pip和pip2对应的是python2.x,pip3对应的是python3.x的版本,python2和python3的模块是独立的,不能混用,混用会出问题。所以命令行通过python3的pip:pip3 安装解析器:
$ pip3 install lxml
3.8M,稍等片刻即可
再次运行项目,完美解决,特此记录
阅读全文
0 0
- python bs4解析网页时 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to inst
- 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
- python3异bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do
- bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib
- Python错误:bs4.FeatureNotFound: Couldn't find a tree builder with the features you
- Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser
- Couldn't find a tree builder with the features you requested: lxml 问题解决
- Why do you need to put #!/bin/bash at the beginning of a script file?
- 25.You need to create a table with the following column specifications:
- java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the
- 1Z0-051 25. You need to create a table with the following column specifications:
- Java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the
- Only then do you need to ......
- What to Do When You Have to Work with Someone You Don't Like
- Error with hilo in NHibernate - “could not read a hi value - you need to populate the table”
- 69.You need to generate a list of all customer last names with their credit limits from the CUSTOMER
- Xcode6:The file couldn’t be opened because you don’t have permission to view it
- InputStreamReader/OutputStreamWriter乱码问题解决
- echarts散点图的心得
- What are the best ways to learn self discipline?
- APP内跳转QQ和陌生人聊天实现客服功能
- iOS 简单自定义状态栏(彷微博)
- python bs4解析网页时 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to inst
- 分享一个python 的小功能:搭建一个本地web服务器
- iOS UITextField输入中文时文字下移bug解决
- OC Swift 混编
- 08 java的package包和jar包
- 用Python做有趣的事儿——打包程序为.exe
- Mac环境安装Tomcat
- Mac 安装 Charles 4.1.2破解
- Mac下打开环境配置文件.bash_profile