scrapy的安装和安装错误及解决方法

scrapy 安装:

sudo apt-get install build-essential
sudo apt-get install python-dev
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install python-setuptools
sudo easy_install Scrapy

打开终端,进入python2环境,输入如下命令

import scrapy #若没报错,则安装成功

安装scrapy问题及解决方法:

安装scrapy出现的错误:

 build/temp.linux-x86_64-2.7/_openssl.c:429:30: fatal error: openssl/opensslv.h: 没有那个文件或目录
    compilation terminated.
    error: command ‘x86_64-linux-gnu-gcc‘ failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__=‘/tmp/pip-build-AQ8e0t/cryptography/setup.py‘;exec(compile(getattr(tokenize, ‘open‘, open)(__file__).read().replace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" install --record /tmp/pip-2cxmRo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-AQ8e0t/cryptography/

出现上述错误,原因是库文件不全,其解决方法如下:

sudo apt-get install libssl-dev

你可能感兴趣的:(网络爬虫)