python bs4解析网页时 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to inst
2017-08-30 13:29
417 查看
Python小白,学习时候用到bs4解析网站,报错
几经周折才知道是bs4调用了python自带的html解析器,我用的mac,默认安装的是python2,所以内置的解释器也是捆绑在python2上,而我学习的时候又自己安装了python3,开发环境也是python3的,貌似是没有html解释器,所以会报错。
问题找到了,那么怎么解决呢?对,在python3也装一个html解析器就好了,那么怎么安装呢?查阅资料获悉:一般pip和pip2对应的是python2.x,pip3对应的是python3.x的版本,python2和python3的模块是独立的,不能混用,混用会出问题。所以命令行通过python3的pip:pip3 安装解析器:
3.8M,稍等片刻即可
再次运行项目,完美解决,特此记录
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,稍等片刻即可
再次运行项目,完美解决,特此记录
相关文章推荐
- Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser
- bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
- Only then do you need to ......
- 转:Python网页解析:BeautifulSoup vs lxml.html
- why do you need ./ to execute programs in current directory?
- ccah-500 第25题 what do you need to do when adding a new slave node to cluster
- Core Java2(7Th) study(1)What sorts of problems do you need to consider?
- SimpleCV install and "You need the python image library to save by filehandle"
- Python豆瓣静态网页抓取,lxml解析和显示(实验)
- geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?
- Do You Need to Bounce E-Business Suite Application Servers Regularly?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- Do you need to disable swap and how to configure swappiness
- python + lxml 解析静态网页
- Python网页解析:BeautifulSoup vs lxml.html
- Python 爬虫 —— 网页内容解析(lxml)
- Android去標題時報錯:java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendan
- How do you link a C++ program to C functions?
- 推送报 java.lang.SecurityException You need MANAGE_USERS permission to check
- python 解析网页,将抓取到的图片保存到本地