pyspider安装中出现的一系列问题

开始安装

pip install pyspider

问题1:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vXo1W3/pycurl

解决
1.先安装curl库,在pycurl中Ctrl+F找到你的电脑所对应的curl版本,进行下载,
2.将上面下载的的文件进行安装,在cmd中执行,命令为:

pip install pycurl-7.43.1-cp37-cp37m-win_amd64.whl

验证
在cmd中

pyspider all

问题2
async关键字问题,

解决:
windows10,安装pyspider,python3.7 成功,但是不能启动pyspider的解决办法
将site-packages下pyspider下的
(1)fetcher/tornado_fetcher.py
(2)run.py
(3)weibu/app.py
三项中的async全部替换成shark

具体替换方法(两种):
1.notepad++先使用Ctr+F找到async,接着点击替换,将此文件中的所有async->shark
2.使用idea中直接从路径中选取进行替换
具体操作:intellij idea全局查找和替换

问题3

ValueError: Invalid configuration: - Deprecated option 'domaincontroller': use 'http_authenticator

解决:

ValueError: Invalid configuration: - Deprecated option ‘domaincontroller’: use 'http_authenticator

最终的结果
在这里插入图片描述
在这里插入图片描述

注:
开始的时候因为没有安装phantomjs时,只是出现了上述结果的前两行,也就是

d:\program files\lib\site-packages\pyspider\libs\utils.py:196: FutureWarning: timeout is not supported on your platform.
  warnings.warn("timeout is not supported on your platform.", FutureWarning)
[I 190409 20:28:52 result_worker:49] result_worker starting...

其他的却不显示,最终按照网上的教程安装phantomjs,最终出现很多的结果。

安装phantomjs
在官网上不能下载,在phantomjs上下载的
并且将phantomjs.exe放在python.exe同一文件目录下

还要注意
将D:\Software\phantomjs-2.1.1-windows\bin添加到环境变量中

pyspider只出现两行内容
在这里插入图片描述

解决:
单独启动fetcher 一直显示fetcher starting…
具体操作:

pip install redis

解决问题的思路
之前是跟着崔庆才的官方网站学习爬虫的,首先就跟着安装一大堆关于爬虫的软件啊包之类的。记得当初学习的时候因为一些网络的原因(不能够上外网,安装一些包软件或者包),前面的没有安装全。所以在看了相关的网页之后,就回去看redis的安装是在pyspider之前的,就尝试着安装了一下,果然就成了

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44517301/article/details/114916232