pycharm环境下配置scrap爬虫环境
【写在开头】
参考文章后面给出了备注信息,是在解决这个问题的时候,查找的比较有亮点的参考文章,如果本文章写的不太清楚的,可以去原文章进行查看。下面列举的四个文章有参考的成分也有验证的成分,解决办法重点参考的是文章4,前面3个只是对pycharm使用和安装包的便捷性上比较有亮点,这里还是进行引用。后面方便对参考文章进行引用,对文献进行编号。
【参考文章】:
1、https://www.cnblogs.com/zengsf/p/9801966.html
pycharm的设置选项中安装文件,只是作为了解,知道可以通过pycharm平台安装和卸载包,该文章也介绍了不能直接安装twisted,所以还是需要下载安装,我是直接从文献4中给的百度盘下载安装的,twisted安装成功之后,可以成功安装scrapy包,但是不能查看scrapy版本,提示scrapy不是内部命令,放弃了,直接看正文部分教程或者文章4。
2、http://www.manongjc.com/article/44529.html
提到的用豆瓣源进行加速安装的命令,对了一下,直接pip install scrapy和使用豆瓣源安装,后者的确很快,看了下https://pypi.douban.com/simple 源社区里面很多包,安装比较慢的时候可以考虑使用,作为了解。
3、https://www.cnblogs.com/llssx/p/8378832.html
给出安装scrapy时会遇到的一些错误提示,和安装scrapy时自下而上的顺序结构图,只是作为了解,文章没有给出解决方案。
4、https://blog.csdn.net/YiXiao1997/article/details/96345737
是一个完整的安装流程,并且给出Twisted的百度盘文件,很方便。文章最后对该教程与该文章进行了对比。
【正文部分】
1、由于入手python的时候就用的pycharm,所以学到scrapy的时候就想着在pycharm下进行一些配置,pycharm有个控制台,见图1,可以直接输入命令行进行安装操作,本来以为直接pip install scrapy就可以了,但事实并不是这样,下图2给出了提示的错误信息,实际提示的错误信息有将近一千多行,直接去最后比较重要的两行,大概意思就是:安装twisted出现错误,Microsoft Visual C++ 14.0文件缺失。(备注:错误提示内容在文献3提到了)
图1 pycharm控制台
图2 错误提示信息:安装twisted出现错误,Microsoft Visual C++ 14.0文件缺失
2、接着根据文献4的提示,下载好twisted的安装包,在pycharm的控制台进行安装程序,安装提示信息如下所示:
D:\zhuomian>pip install Twisted-19.2.0-cp37-cp37m-win_amd64.whl
Processing d:\zhuomian\twisted-19.2.0-cp37-cp37m-win_amd64.whl
Requirement already satisfied: constantly>=15.1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twiste
d==19.2.0) (15.1.0)
Requirement already satisfied: attrs>=17.4.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twisted==
19.2.0) (19.1.0)
Requirement already satisfied: PyHamcrest>=1.9.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twist
ed==19.2.0) (1.9.0)
Requirement already satisfied: zope.interface>=4.4.2 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from T
wisted==19.2.0) (4.6.0)
Requirement already satisfied: incremental>=16.10.1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Tw
isted==19.2.0) (17.5.0)
Requirement already satisfied: Automat>=0.3.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twisted=
=19.2.0) (0.7.0)
Requirement already satisfied: hyperlink>=17.1.1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twist
ed==19.2.0) (19.0.0)
Requirement already satisfied: six in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from PyHamcrest>=1.9.0->
Twisted==19.2.0) (1.12.0)
Requirement already satisfied: setuptools in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from PyHamcrest>=
1.9.0->Twisted==19.2.0) (39.0.1)
Requirement already satisfied: idna>=2.5 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from hyperlink>=17
.1.1->Twisted==19.2.0) (2.8)
Installing collected packages: Twisted
Successfully installed Twisted-19.2.0
3、安装好twisted之后,使用命令pip install scrapy继续安装scrapy,下面是控制台提示信息,成功安装。
D:\zhuomian>pip install scrapy
Collecting scrapy
Using cached https://files.pythonhosted.org/packages/a3/b1/d1ab5b3f84640097cf5ff642e2e357546781746d4fec2ebb40432904c57d/Scrapy-1.7.2-py2.py3-n
one-any.whl
Requirement already satisfied: lxml in c:\users\余生,别无他求\appdata\roaming\python\python37\site-packages (from scrapy) (4.3.4)
Requirement already satisfied: pyOpenSSL in c:\users\余生,别无他求\appdata\roaming\python\python37\site-packages (from scrapy) (19.0.0)
Requirement already satisfied: Twisted>=13.1.0; python_version != "3.4" in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\si
te-packages (from scrapy) (19.2.0)
Requirement already satisfied: queuelib in c:\users\余生,别无他求\appdata\roaming\python\python37\site-packages (from scrapy) (1.5.0)
Requirement already satisfied: six>=1.5.2 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from scrapy) (1.1
2.0)
Requirement already satisfied: service-identity in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from scrapy
) (18.1.0)
Requirement already satisfied: cssselect>=0.9 in c:\users\余生,别无他求\appdata\roaming\python\python37\site-packages (from scrapy) (1.0.3)
Requirement already satisfied: w3lib>=1.17.0 in c:\users\余生,别无他求\appdata\roaming\python\python37\site-packages (from scrapy) (1.20.0)
Requirement already satisfied: PyDispatcher>=2.0.5 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from scr
apy) (2.0.5)
Requirement already satisfied: parsel>=1.5 in c:\users\余生,别无他求\appdata\roaming\python\python37\site-packages (from scrapy) (1.5.1)
Requirement already satisfied: cryptography>=2.3 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from pyOpe
nSSL->scrapy) (2.7)
Requirement already satisfied: PyHamcrest>=1.9.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twist
ed>=13.1.0; python_version != "3.4"->scrapy) (1.9.0)
Requirement already satisfied: incremental>=16.10.1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Tw
isted>=13.1.0; python_version != "3.4"->scrapy) (17.5.0)
Requirement already satisfied: hyperlink>=17.1.1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twist
ed>=13.1.0; python_version != "3.4"->scrapy) (19.0.0)
Requirement already satisfied: Automat>=0.3.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twisted>
=13.1.0; python_version != "3.4"->scrapy) (0.7.0)
Requirement already satisfied: constantly>=15.1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twiste
d>=13.1.0; python_version != "3.4"->scrapy) (15.1.0)
Requirement already satisfied: zope.interface>=4.4.2 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from T
wisted>=13.1.0; python_version != "3.4"->scrapy) (4.6.0)
Requirement already satisfied: attrs>=17.4.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from Twisted>=
13.1.0; python_version != "3.4"->scrapy) (19.1.0)
Requirement already satisfied: pyasn1 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from service-identity
->scrapy) (0.4.5)
Requirement already satisfied: pyasn1-modules in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from service-
identity->scrapy) (0.2.5)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from cryp
tography>=2.3->pyOpenSSL->scrapy) (1.12.3)
Requirement already satisfied: asn1crypto>=0.21.0 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from cryp
tography>=2.3->pyOpenSSL->scrapy) (0.24.0)
Requirement already satisfied: setuptools in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from PyHamcrest>=
1.9.0->Twisted>=13.1.0; python_version != "3.4"->scrapy) (39.0.1)
Requirement already satisfied: idna>=2.5 in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from hyperlink>=17
.1.1->Twisted>=13.1.0; python_version != "3.4"->scrapy) (2.8)
Requirement already satisfied: pycparser in c:\users\余生,别无他求\appdata\local\programs\python\python37\lib\site-packages (from cffi!=1.11.3,
>=1.8->cryptography>=2.3->pyOpenSSL->scrapy) (2.19)
Installing collected packages: scrapy
Successfully installed scrapy-1.7.2
4、进行验证,查看scrapy版本,没有提示scrapy不是内部命令,也给出了版本信息,说明安装成功
D:\zhuomian>scrapy
Scrapy 1.7.2 - no active project Usage:
scrapy <command> [options] [args] Available commands:
bench Run quick benchmark test
fetch Fetch a URL using the Scrapy downloader
genspider Generate new spider using pre-defined templates
runspider Run a self-contained spider (without creating a project)
settings Get settings values
shell Interactive scraping console
startproject Create new project
version Print Scrapy version
view Open URL in browser, as seen by Scrapy [ more ] More commands available when run from project directory Use "scrapy <command> -h" to see more info about a command
【写在最后】
就像前面说的,这篇文章是自己对在学习scrapy环境配置的时候,遇到的问题的一个记录,参考的还是网上的解决办法,但同时也是对网上的教程的一个验证,前面四篇文章的备注都作出了说明,对比一下第四篇参考文章,我这里没有安装wheel工具包,直接安装的twisted,也是可以成功安装的。
写到这里,只是进行了环境配置,还没有进行验证,是不是可以成功进行项目开发,下一篇进行讲解,scrapy简单的项目开发。
小编尊重原创,文章如有侵权,联系小编删帖,谢谢监督。转发请备注出处!
pycharm环境下配置scrap爬虫环境的更多相关文章
- 【转】在Eclipse环境下配置Servlet开发环境
配置这个真心坑···浪费我一下午时间,而且去网上找了一圈资料发现都不靠谱呀= = 于是自己写一个,防止忘记了 一.配置前准备 你需要下载三个东西 Eclipse J2EE:http://www.ecl ...
- 在Win环境下配置java的环境进行开发步骤
1.下载官方JDK,网址如下 http://www.oracle.com/technetwork/java/javase/downloads/index.html
- WIN7环境下配置vscode c++环境
目录 安装vscode 添加中文环境支持 添加c++支持 配置c++环境 安装MinGW 配置MinGW环境变量 配置vscode launch文件配置 task文件配置 可能出现的问题 安装vsco ...
- Mac环境下 配置Python数据分析环境
采取的思路主要依据的是这一篇文章,连接: http://www.jb51.net/article/78667.htm 但是当安装brew的时候,可能是网站的问题,一直报错 所以从网上查找资料发现,br ...
- lua redis接口 (在ubuntu16.04 环境下配置lua-redis开发环境)
目前成功的lua版本是5.1, 根据网络上的资料显示 lua5.1能够支持 lua-socket 安装lua及相关软件: #安装lua5. #安装lua-socketxiangg sudo apt i ...
- Centos7.4环境下搭建Python开发环境(虚拟机安装+python安装+pycharm安装)
目录 一.安装 Centos7.4虚拟机 二.安装 python3.6.7 三.安装 pycharm 一般情况下,大家都是在 Windows平台下进行 Python开发,软件安装和环境搭建都非常&qu ...
- 【经验之谈】Windows环境下配置WordPress
前言 wordpress全球著名的开放博客平台,拥有成千上万个各式插件和不计其数的主题模板样式,使用php和mysql搭建,下面说下载windows环境下配置wordpress,经验之谈. 安装 关于 ...
- [原创]IIS7.5下配置ASP+PHP环境及错误处理(0xc0000135)
IIS7.5下配置ASP+PHP环境及错误处理(0xc0000135) http://user.qzone.qq.com/93701178/blog/1398155812 操作系统更新至Win7或Wi ...
- nginx环境下配置nagios-关于nagios配置文件nginx.conf
接上文:nginx环境下配置nagios-关于nginx.conf 配置如下: ; location ~ .*\.(php|php5)?$ { ...
随机推荐
- shell脚本 批量添加删除用户
2021-07-26 1.批量添加用户 # 编写脚本 vi add_student_50.sh # 添加用户组 student groupadd student # 添加用户 student1-stu ...
- vue 引用省市区三级联动(插件)
vue 用省市区三级联动之傻瓜式教程(复制粘贴即用) npm 下载 npm install v-distpicker --save main.js //引入 省市区三级联动 import Distpi ...
- Python之requests模块-大文件分片上传
最近在做接口测试时,拿到一个分片上传文件的接口,http接口请求头中的Content-Type为multipart/form-data.需要在客户端将大文件分片成数据块后,依次传给服务端,由服务端还原 ...
- Python - 面向对象编程 - 魔术方法(双下划线方法)
什么是魔术方法 在Python中,所有以 __ 双下划线包起来的方法,都统称为 Magic Method 魔术方法,也叫双下划线方法 有哪些重要的魔术方法? __new__ https://www.c ...
- Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
背景:运行代码提示找不到ADB An unknown server-side error occurred while processing the command. Original error: ...
- 学习Tomcat(二)之容器概览
Tomcat容器的Server模块有管理容器的启动和关闭.管理了容器内的服务组件Service.管理了全局JNDI资源的功能,对Tomcat容器的生命周期管理有重要意义.Tomcat的服务组件则是To ...
- Dockerfile 自动制作 Docker 镜像(一)—— 基本命令
Dockerfile 自动制作 Docker 镜像(一)-- 基本命令 前言 a. 本文主要为 Docker的视频教程 笔记. b. 环境为 CentOS 7.0 云服务器 c. 上一篇:手动制作Do ...
- CodeForce-702C Cellular Network(查找)
Cellular Network CodeForces - 702C 给定 n (城市数量) 和 m (灯塔数量): 给定 a1~an 城市坐标: 给定 b1~bm 灯塔坐标: 求出灯塔照亮的最小半径 ...
- 01-mysql必知必会
概述 主键:唯一区分表中每个行(不可重复,不允许null mysql:基于客户-服务器的数据库系统 使用mysql mysql是部署在主机上的,可以通过ssh建立mysql连接 # 显示数据库 sho ...
- win7下python2.7安装 pip,setuptools的正确方法
windows7 下 0.先安装python2.7.13 32位:https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi 64位:htt ...