2

I just bought a raspberry pi 2. I want to run some python scripts on it. When it asked me which operating system to install I believe I chose debian. This OS appears to have python already installed. 2.7 and 3. I have tried a large number of things to try to install scrapy, but it always fails. It fails at:

Compile failed: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
/tmp/easy_install/-WZYRhq/lxml-3.5.0/temp/xmlXPathInitXlkHzS.c:1:25: fatal error: libxml/xpath.h No such file or directory.

compilation terminated

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

error: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1.

I have downloaded the scrapy zip file from their website and unpacked it, and run their installer by typing:

sudo python setup.py install

I have tried using pip to install libxml2, but this did not fix anything. In fact it said that no distributions at all found for libxml2, and the error still occurs.

Any clue what's happening here?

Javitronxo
  • 817
  • 6
  • 9
user1250991
  • 97
  • 2
  • 12
  • Ubuntu is based on Debian, so the following should work: http://stackoverflow.com/questions/6504810/how-to-install-lxml-on-ubuntu – Charles L. Feb 12 '16 at 02:16
  • Have you tried installing scrapy with `pip install scrapy` instead of the zip file from their web? It worked fine in my RPi 2 – Javitronxo Feb 12 '16 at 11:42
  • You need some c bindings to build this. They can be installed with apt-get on debian and ubuntu. Probably something like this: `sudo apt-get install python-dev libxml2-dev` – Håken Lid Feb 12 '16 at 13:05
  • @Javitronxo, pip install scrapy does not work for me. – user1250991 Feb 13 '16 at 05:58
  • 1
    @HåkenLid I just did that, it finished the installation and then i `ran pip install scrapy`, and i no longer get the same error, but I get a new one that says: `In file included from src/lxml/lxml.etree.c:323:0: /src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h No such file or directory # include "libxml/xmlversion.h" compilation terminated. Compile failed: command 'arm-linux-gnueabihf-gcc' failed with exit status 1` – user1250991 Feb 13 '16 at 05:59
  • 1
    I seem to have fixed it. Here's what I did (im guesing only the 2nd apt get is actually required: `sudo apt-get install python-dev libxml2-dev` `sudo apt-get install libxml2-dev libxslt1-dev python-dev` `sudo python setup.py install` it seems to have installed, but i havent run any scripts with scrapy yet. – user1250991 Feb 13 '16 at 06:18
  • Just a note, it looked like the installation was stuck on the step associated with the string "Using build configuration of libxslt 1.1.28". I let it sit there and a few minutes later it kept installing. – user1250991 Feb 13 '16 at 06:22

0 Answers0