从零安装Scrapy心得 | Install Python Scrapy from scratch
1. 介绍
Scrapy,是基于python的网络爬虫框架,它能从网络上爬下来信息,是data获取的一个好方式。于是想安装下看看。
进到它的官网,安装的介绍页面
https://docs.scrapy.org/en/latest/intro/install.html
2. 失败的安装过程
有3种装法,一个是从pip,一个是从源码编译,一个是从conda
根据之前的知识,pip就已经是集成在python中的包管理工具,最简单明了,就忽视了官网介绍界面的一句话
Note that sometimes this may require solving compilation issues for some Scrapy dependencies depending on your operating system
结果在编译阶段报了很多错误,解决一个还有一个。
然后就放弃了,从源码编译,跟pip一样,也是一堆编译错误。
3. conda方式安装
没办法,就去看conda,下载了个miniconda,60多M吧。仔细一研究结果爽死了。
可能python也注意到了它的包下载下来需要编译,编译的话需要依赖自己OS的环境配置,经常出错的这个问题。
miniconda是个已经安装好了python的一个集成环境,等于下载安装好了miniconda也就是下载好了基本的python核心程序,然后可以通过conda命令来来下载conda已经编译好的包来做功能扩展。也就是scrapy包以及它依赖的lxml,twisted等编译的我半死的包都是已经跟编译好的。那下载下来直接用就可以了。
conda install -c conda-forge scrapy
https://conda.io/docs/install/quick.html
https://conda.io/miniconda.html
English Version
1. Introduction
Scrapy, it's a network crawler framework based on Python, which is able to download infomation from Internet, so it's a good way to obtain original data.
For better understanding towards Scrapy, I found the installation instruction on below official website and try to install scrapy framework.
https://docs.scrapy.org/en/latest/intro/install.html
2. Failure experience of installion
Before install Scrapy framework, there must be Python environment in your computer, Scrapy is one of Python extension packages from view of Python.
If Python env is already here, then there are 3 ways to install Scrapy package: 1 is thru pip, 2 is to compile dependencies from source code, 3 is thru conda.
Based on my previous experience and knowledge, pip is the package management tool that already integrated in python env. It's quite straightforward to use pip for installation. However I had overlooked one important note from official website, which is
Note that sometimes this may require solving compilation issues for some Scrapy dependencies depending on your operating system
As a result, there were many compilation errors during the denpendencies installation process, when you solved one, another error occurred. Therefore i tried second installation method but still get the same result as first method.
3. Install thru conda
The last option for me is to install Scrapy thru conda. I found conda offitial website, and downloaded miniconda as per instruction, around 60 Megabytes. After install and run the tool, it is really cool and make things simple. It might noticed that dependencies complilation issue always drive people craze, as it depends on the OS environment.
Conda is a integrated Python environment with core Python packages. Users who want to install packages just need to download those packages instead of compile them locally, such as lxml, twisted Scrapy dependencies packages. All extension packages have been compiled on Conda server, therefore, it avoid the issue that happened above.
The package download or so called installation syntax is as below
conda install -c conda-forge scrapy
https://conda.io/docs/install/quick.html
https://conda.io/miniconda.html
从零安装Scrapy心得 | Install Python Scrapy from scratch的更多相关文章
- python Scrapy安装和介绍
python Scrapy安装和介绍 Windows7下安装1.执行easy_install Scrapy Centos6.5下安装 1.库文件安装yum install libxslt-devel ...
- Python Scrapy安装杂症记录
昨天安装了scrapy一切正常,调试了bbsSpider案例(详见上文),今日开机因为冰封还原,提示找不到python27.dll,重新安装了python2.7, 使用easy-install scr ...
- Python Scrapy安装
直接安装scrapy 各种报错,后来各种百度终于解决了,如下是亲身的经历. pip install scrapy 这样直接会报错. 第一步: 先安装wheel pip install wheel 第二 ...
- Python -- Scrapy 框架简单介绍(Scrapy 安装及项目创建)
Python -- Scrapy 框架简单介绍 最近在学习python 爬虫,先后了解学习urllib.urllib2.requests等,后来发现爬虫也有很多框架,而推荐学习最多就是Scrapy框架 ...
- Python Scrapy在windows上的安装方法
如果想要学习爬虫,肯定会了解Scrapy,但安装Scrapy的方法相对于安装其他第三方库麻烦一点. 下面总结一下在我的电脑上安装Scrapy的方法,我的电脑是Windows10,32位操作系统.有如下 ...
- [已解决]报错: Python Scrapy - service_identity(opentype) not working and cannot install
解决:更新安装service_identity pip3 install service_identity --force --upgrade
- Python.Scrapy.14-scrapy-source-code-analysis-part-4
Scrapy 源代码分析系列-4 scrapy.commands 子包 子包scrapy.commands定义了在命令scrapy中使用的子命令(subcommand): bench, check, ...
- windows下,python+scrapy环境搭建
•安装lxml(官网给出的地址http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml,下载whl文件安装) •安装zope.interface https:// ...
- python scrapy 基础
scrapy是用python写的一个库,使用它可以方便的抓取网页. 主页地址http://scrapy.org/ 文档 http://doc.scrapy.org/en/latest/index.ht ...
随机推荐
- 要学好JAVA要注意些什么?
从自学开始到参加系统的学习JAVA已经差不多有1个月了的时间了,在这段时间以前我也和很多人一样在网上盲目的搜罗一些视频来自己啃,随着时间的积累,对JAVA的认识也有了一定的提升,之前可能因为在IT咨询 ...
- NOIP2016 天天爱跑步 80分暴力
https://www.luogu.org/problem/show?pid=1600 题目描述 小c同学认为跑步非常有趣,于是决定制作一款叫做<天天爱跑步>的游戏.«天天爱跑步»是一个养 ...
- Junit 4 测试中使用定时任务操作
难度:测试中执行线程操作 package com.hfepc.job.dataCollection.test; import java.util.Date; import java.util.List ...
- var 和 let 的异同?
相同点 声明后未赋值表现一致 不同点 1.使用未声明的变量表现不同 2.变量作用范围不同 3.var可以声明多次 let只能声明一次 let的好处就是当我们在写代码的时候可以避免在不知道的情况下重复声 ...
- docker实践
我的docker 学习笔记2 ps axf docker run -d cyf:sshd /usr/sbin -D docker ps docker-enter.sh 686 ps axf ...
- maven常见问题处理(3-3)Gradle编译时下载依赖失败解决方法
Gradle编译时在本地仓库中如果没有发现依赖,就会从远程仓库中下载, 默认的远程仓库为 mavenCentral(),即 http://repo1.maven.org/maven2/往往访问速度特别 ...
- ICC_lab总结——ICC_lab5:布线&&数字集成电路物理设计学习总结——布线
字丑,禁止转载! 这里将理论总结和实践放在一起了. 布线的理论总结如下所示: 下面是使用ICC进行实践的流程: 本次的布线实验主要达成的目标是: ·对具有时钟树布局后的设计进行可布线性检查 ·完成布线 ...
- python 类知识点总结
python 类知识点总结 面向对象思想: 1.设计的时候,一定要明确应用场景 2.由对象分析定义类的时候,找不到共同特征和技能不用强求 1.简述类.对象.实例化.实例这些名词的含义: 类:从一组对象 ...
- SpringMVC(七):@RequestMapping下使用POJO对象绑定请求参数值
Spring MVC会按照请求参数名和POJO属性名进行自动匹配,自动为该对象填充属性值,支持级联属性. 如:address.city.dept.address.province等. 步骤一:定义Ac ...
- 南京邮电大学java程序设计作业在线编程第四次作业
王利国的的 "Java语言程序设计第4次作业(2018)" 详细 主页 我的作业列表 作业结果详细 总分:100 选择题得分:40 1.下列方法定义中,正确的是() A.doub ...