pip sintall pyspider 报错:ERROR: Command errored out with exit status 10


系统环境:
Windows 10 64位
Python 3.6.5

pyspider 是国人写的一款开源爬虫框架,作者博客:http://blog.binux.me/ ,使用 pip install pyspider 命令即可安装 pyspider,安装报错如下:

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 所标识的对象)

解决方法:访问 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

posted @ 2019-09-15 15:04  TRHX  阅读(874)  评论(0编辑  收藏  举报