当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《数据科学引论——Python之道》课程教学资源(课件)05 爬虫环境搭建

资源类别:文库,文档格式:PDF,文档页数:3,文件大小:60.95KB,团购合买
点击下载完整版文档(PDF)

概述 我们将用anaconda自带的conda工具安装爬虫库,爬虫库名为scrapy,版本直接安装 最新版即可。 在安装scrapy之前,我们需要先将conda的源从国外的切换成国内的,否则容易出现 下载超时的问题。 有兴趣了解conda具体干嘛的,可以参考链接https://conda.io/docs/intro.html。当然 你也可以无视,就按我以下的命令打到命令行里就好了。 切换源 管理员打开cmd 默认源会比较慢也容易被墙,在这里我们使用清华的源。在命令行中输入 1#添加Anaconda的TUNA镜像 2 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 3 #TUNA的help中镜像地址加有引号,需要去掉#设置搜索时显示通道地址 conda config --set show channel urls yes 安装 conda install scrapy 如果出现 CondaIOError:IO error:Missing write permissions in:C:\Program Files\Anaconda3 2# 3 You don't appear to have the necessary permissions to install packages 4 into the install area 'C:\Program Files\Anaconda3'. 5 However you can clone this environment into your home directory and 6 then make changes to it. This may be done using the command: 就是权限不够,记住一定要用管理员身份打开命令行

概述 我们将用 anaconda 自带的 conda 工具安装爬虫库,爬虫库名为 scrapy,版本直接安装 最新版即可。 在安装 scrapy 之前,我们需要先将 conda 的源从国外的切换成国内的,否则容易出现 下载超时的问题。 有兴趣了解 conda 具体干嘛的,可以参考链接 https://conda.io/docs/intro.html。当 然 你也可以无视,就按我以下的命令打到命令行里就好了。 切换源 管理员打开 cmd 默认源会比较慢也容易被墙,在这里我们使用清华的源。在命令行中输入 1 # 添加 Anaconda 的 TUNA 镜像 2 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 3 # TUNA 的 help 中镜像地址加有引号,需要去掉# 设置搜索时显示通道地址 4 conda config --set show_channel_urls yes 5 安装 如果出现 1 CondaIOError: IO error: Missing write permissions in: C:\Program Files\Anaconda3 2 # 3 # You don't appear to have the necessary permissions to install packages 4 # into the install area 'C:\Program Files\Anaconda3'. 5 # However you can clone this environment into your home directory and 6 # then make changes to it. 7 # This may be done using the command: 就是权限不够,记住一定要用管理员身份打开命令行。 1 conda install scrapy

成功的标志 安装过程会输出很多内容,如下。其实只要看到最后有三个COMPLETE即可。 C:\WINDOWS\system32>conda install scrapy Fetching package metadata Solving package specifications:....... 5 Package plan for installation in environment C:\Program Files\Anaconda3: 6 > The following packages will be downloaded: 9 package build 10 11 conda-env-2.6.0 0 498B https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 12 13 14 15 scrapy-1.3.3 py35_0 335KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 16 17 Total: 6.5MB 18 19 The following NEW packages will be INSTALLED: 20 21 attrs: 15.2.0-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 22 23 444 24 25 zope.interface:4.4.2-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 26 27 The following packages will be UPDATED: 28 29 conda: 4.2.9-py35_0 defaults ->4.3.22-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 30 pyopenss1: 16.0.0-py35_0 defaults -->16.2.0-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 31 requests: 2.11.1-py35_0 defaults ->2.14.2-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

成功的标志 安装过程会输出很多内容,如下。 其实只要看到最后有三个 COMPLETE 即可。 1 C:\WINDOWS\system32>conda install scrapy Fetching package metadata ……….. Solving package specifications: ………. Package plan for installation in environment C:\Program Files\Anaconda3: The following packages will be downloaded: package | build ---------------------------|----------------- conda-env-2.6.0 | 0 498 B https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free ……………. scrapy-1.3.3 | py35_0 335 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free ------------------------------------------------------------ Total: 6.5 MB The following NEW packages will be INSTALLED: attrs: 15.2.0-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free ………………………… zope.interface: 4.4.2-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free The following packages will be UPDATED: conda: 4.2.9-py35_0 defaults --> 4.3.22-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free pyopenssl: 16.0.0-py35_0 defaults --> 16.2.0-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free requests: 2.11.1-py35_0 defaults --> 2.14.2-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

32 33 Proceed ([y]/n)?y 34 35 Fetching packages . 36 c0nda-enV-2.6.100%|####################|Time:日:00:00 124.47kB/s 37 38 39 40 SerV1ce_1 denti100%|####################|Time: 0:00:00 3.78MB/s 41 scrapy-1.3.3-p100%|####################|Time: 日:00:00 891.24kB/5 42 Extracting packages .. 43 COMPLETE ]川##########料#############| 100% 44 Unlinking packages .. 45 COMPLETE ]川种###料########################| 108% 46 Linking packages.. 47 COMPLETE ]川种###料########################| 100%

32 33 Proceed ([y]/n)? y 34 35 Fetching packages … 36 conda-env-2.6. 100% |###############################| Time: 0:00:00 124.47 kB/s 37 38 ……………………. 39 40 service_identi 100% |###############################| Time: 0:00:00 3.78 MB/s 41 scrapy-1.3.3-p 100% |###############################| Time: 0:00:00 891.24 kB/s 42 Extracting packages … 43 [ COMPLETE ]|##################################################| 100% 44 Unlinking packages … 45 [ COMPLETE ]|##################################################| 100% 46 Linking packages … 47 [ COMPLETE ]|##################################################| 100%

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有