How to Install rdflib

At the Linked Data preconference at Code4Lib 2009 a couple of weeks ago, I learned about the rdflib Python library. Naturally, I wanted to install the library so I could mess with it on my own. That proved to be a little problematic, though. Following the installation instructions, I typed:

$ easy_install -U "rdflib>=2.4,<=3.0a"

And it very helpfully told me (among other things):

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes
-fPIC -I/usr/include/python2.5 -c src/bison/SPARQLParser.c -o
src/bison/SPARQLParser.c:7:20: error: Python.h: No such file or directory

As it turns out, I should have had python-dev and build-essential already installed. Being new to Linux, I did not know. Thanks, BenO, for helping me out with this.

The complete installation instructions:

$ apt-get install python-dev
$ apt-get install build-essential
$ easy_install "rdflib==2.4.0"

3 Responses to How to Install rdflib

  1. Jon Gorman says:

    This is one thing that more and more distros have been doing over the past couple years that bugs me a bit. I don’t know why build-essential isn’t part of the default install. The lovely idea that the package manager will be able to always use a binary or never need to use c headers seems pretty rare, except maybe for the most mom & pop users.

    And not including the -devel packages by default? I guess they’re trying to save bandwidth.

    I suppose there could be a security concern, but really, how many worms/virus/etc re-compile themselves?

    Still, everytime I find myself working with a new linux system, I run into exactly this problem. Annoying, but I guess it isn’t too bad. Thank goodness for the Internet and Google.

  2. Pingback: Installing RDFlib on osX « Parerga und Paralipomena

  3. Pingback: Parerga und Paralipomena » Blog Archive » Installing RDFlib on osX