python ImportError: No module named 'requests'

python,安装了python3.6.5的环境后,在网上下载了一个python文件运行的时候,提示ImportError: No module named 'requests'(找不到requests模块)。

爬虫用

requests介绍:requests是python的一个HTTP客户端库,跟urllib,urllib2类似,那为什么要用requests而不用urllib2呢?官方文档中是这样说明的:python的标准库urllib2提供了大部分需要的HTTP功能,但是API太逆天了,一个简单的功能就需要一大堆代码。

①cmd 

②cd D:/Python       //进入D盘  cd命令进入python安装目录

pip install requests     //使用pip 安装

等待系统自动加载安装

pip安装bs4

pip install beautifulsoup4

pip安装 xlwt

pip install xlwt

pip install xlrd

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解析器

pip安装lxml

pip install lxml

猜你喜欢

转载自blog.csdn.net/weixin_37627291/article/details/80808318