[rrd-users] Python can't find rrdtool module after compiling RRDtool 1.5.4 on Debian

cville elkerbou at xs4all.nl
Fri Feb 19 16:59:10 CET 2016

I'm trying to install RRDtool 1.5.4 from source on a Raspberry Pi. I've
gotten to the stage where rrdtool runs OK from the command line but my
working and tested [on another system] Python program can't access rrdtool:

    pi at logger ~/rrd $ ./rrd-write-rfh.py
    Traceback (most recent call last):
      File "./rrd-write-rfh.py", line 14, in <module>
        import rrdtool
    ImportError: No module named rrdtool

Here's the output of "make install" which lists a problem with PYTHONPATH
that I don't fully understand:

    running install
    Checking .pth file support in local/lib/python2.7/dist-packages/
    /usr/bin/python -E -c pass
    TEST FAILED: local/lib/python2.7/dist-packages/ does NOT support .pth
    error: bad install directory or PYTHONPATH

    You are attempting to install a package to a directory that is not
    on PYTHONPATH and which Python does not read ".pth" files from.  The
    installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:


    and your PYTHONPATH environment variable currently contains:


    Here are some of your options for correcting the problem:

    * You can choose a different installation directory, i.e., one that is
      on PYTHONPATH or supports .pth files

    * You can add the installation directory to the PYTHONPATH environment
      variable.  (It must then also be on PYTHONPATH whenever you run
      Python and want to use the package(s) you are installing.)

Please note that the output shows PYTHONPATH as '' [empty string] whereas
the output of printenv clearly shows that PYTHONPATH is defined:


Can anyone explain this anomaly and/or suggest a solution that will allow me
to call rrdtool from Python?

View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/Python-can-t-find-rrdtool-module-after-compiling-RRDtool-1-5-4-on-Debian-tp7583285.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.

More information about the rrd-users mailing list