Python安装,简单爬虫开发环境起步

1.python-3.6.1.exe
  1)安装时选择add to path 和 for all user
  2)安装32位是出于兼容更多开发库的考虑


2.验证
  1)cmd python
  2)from urllib.request import urlopen 无报错说明安装成功


3.安装beautifulSoup4
  cmd: pip install beautifulsoup4
  如果报[WinError 5]拒绝访问,尝试以管理员运行方式开启CMD  
  验证安装成功,不报错即可
  在python命令行下输入: from bs4 import BeautifulSoup
  
4.安装python编译器pyCharm(Community Edition即可)
  示例:

from urllibimportrequest
resp=request.urlopen("http://www.baidu.com")
print(resp.read().decode("utf-8"))

猜你喜欢

转载自www.cnblogs.com/lyInfo/p/9063735.html
今日推荐