python-rrdtool icon indicating copy to clipboard operation
python-rrdtool copied to clipboard

Installation with pip fails if libraries are anywhere other than /usr/

Open darksidelemm opened this issue 4 years ago • 1 comments

Describe the bug The tests performed during pip install, which attempt to build a small amount of source code including rrd.h only use /usr/include/ and /usr/lib/ as include and lib directories. Under OSX / Macports, these directories should be /opt/local/include and /opt/local/lib . As a result, rrdtool cannot be installed via pip within a Macports system.

Collecting rrdtool
  Using cached rrdtool-0.1.15.tar.gz (21 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/darkside/Dev/kiwisnr/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-install-47rqsze7/rrdtool/setup.py'"'"'; __file__='"'"'/private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-install-47rqsze7/rrdtool/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 /private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-pip-egg-info-qwj88vz5
         cwd: /private/var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/pip-install-47rqsze7/rrdtool/
    Complete output (5 lines):
    /var/folders/g5/f1sl_t4x2yn65bnb66pkwssm0000gn/T/tmp_python_rrdtool0a8kjkfx/test_rrdtool.c:2:10: fatal error: 'rrd.h' file not found
    #include <rrd.h>
             ^~~~~~~
    1 error generated.
    Error: Unable to compile the binary module. Do you have the rrdtool header and libraries installed?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

To Reproduce Steps to reproduce the behaviour:

  • Use Macports, or have librrd installed anywhere other than /usr/include /usr/lib
  • Attempt to run: pip install rrdtool (ideally within a venv)

Desktop (please complete the following information):

  • Python version: 3.7.9
  • RRDtool version: 1.7.1 (installed to /opt/local/)
  • python-rrdtool version: 0.1.15 (via pip)

darksidelemm avatar Mar 15 '21 07:03 darksidelemm

I should note that just adding on /opt/local/include and /opt/local/lib into the relevant variables in setup.py made this build just fine on my system, but i'm unsure if that will work on systems where those directories do not exist.

darksidelemm avatar Mar 15 '21 08:03 darksidelemm