系统环境:
Windows 10 64位
Python 3.6.5css
pyspider 是国人写的一款开源爬虫框架,做者博客:http://blog.binux.me/ ,使用 pip install pyspider
命令便可安装 pyspider,安装报错以下:python
C:\Users\Lenovo>pip install pyspider Collecting pyspider Downloading https://files.pythonhosted.org/packages/d0/97/d6062c928f53d899ff2a8538fed11d4d425ba3d27c96248a2c601c1c9fef/pyspider-0.3.10.tar.gz (110kB) |████████████████████████████████| 112kB 819kB/s Requirement already satisfied: Flask>=0.10 in e:\python\lib\site-packages (from pyspider) (1.1.1) Requirement already satisfied: Jinja2>=2.7 in e:\python\lib\site-packages (from pyspider) (2.10.1) Requirement already satisfied: chardet>=2.2 in e:\python\lib\site-packages (from pyspider) (3.0.4) Requirement already satisfied: cssselect>=0.9 in e:\python\lib\site-packages (from pyspider) (1.1.0) Requirement already satisfied: lxml in e:\python\lib\site-packages (from pyspider) (4.3.4) Collecting pycurl (from pyspider) Downloading https://files.pythonhosted.org/packages/ac/b3/0f3979633b7890bab6098d84c84467030b807a1e2b31f5d30103af5a71ca/pycurl-7.43.0.3.tar.gz (215kB) |████████████████████████████████| 215kB 595kB/s ERROR: Command errored out with exit status 10: command: 'e:\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-7vptovzg\\pycurl\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-7vptovzg\\pycurl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-install-7vptovzg\pycurl\ Complete output (1 lines): Please specify --curl-dir=/path/to/built/libcurl ---------------------------------------- ERROR: Command errored out with exit status 10: python setup.py egg_info Check the logs for full command output.
缘由分析:PyCurl 安装错误,须要安装 PyCurl 库(PyCurl 是一个Python接口,是多协议文件传输库的 libcurl。相似于urllib Python模块,PyCurl 能够用来从Python程序获取 URL 所标识的对象)shell
解决方法:访问 https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycurl ,下载对应的 wheel 文件,好比我是 Windows 10 64位,Python 3.6.5,则下载 pycurl‑7.43.0.3‑cp36‑cp36m‑win_amd64.whl,而后使用命令 pip install pycurl‑7.43.0.3‑cp36‑cp36m‑win_amd64.whl
进行安装便可,PyCurl 安装完成,再次执行 pip install pyspider
便可成功安装 pyspider框架