系統環境:
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框架