Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Mac OS X El Capitan上安装python-rrdtool-1.4.7_Python_Macos_Rrd - Fatal编程技术网

在Mac OS X El Capitan上安装python-rrdtool-1.4.7

在Mac OS X El Capitan上安装python-rrdtool-1.4.7,python,macos,rrd,Python,Macos,Rrd,我想用python来crudrrd,但是当我pip安装python rrdtool时。警告如下: ➜ python-rrdtool-1.4.7 sudo python setup.py install Password: running install running build running build_ext running build_configure building 'rrdtoolmodule' extension cc -fno-strict-aliasing -fno-

我想用python来crud
rrd
,但是当我
pip安装python rrdtool
时。警告如下:

➜  python-rrdtool-1.4.7  sudo python  setup.py install
Password:
running install
running build
running build_ext
running build_configure
building 'rrdtoolmodule' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Irrdtool-1.4.7/src -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c rrdtool-1.4.7/bindings/python/rrdtoolmodule.c -o build/temp.macosx-10.11-intel-2.7/rrdtool-1.4.7/bindings/python/rrdtoolmodule.o
rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:69:18: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    args_count = PyTuple_Size(args);
               ~ ^~~~~~~~~~~~~~~~~~
rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:375:15: warning: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    if ((ts = rrd_first(argc, argv)) == -1) {
            ~ ^~~~~~~~~~~~~~~~~~~~~
rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:400:15: warning: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    if ((ts = rrd_last(argc, argv)) == -1) {
            ~ ^~~~~~~~~~~~~~~~~~~~
3 warnings generated.
In file included from rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:44:
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8:
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:1062:9: warning: 'SIZEOF_TIME_T' macro redefined [-Wmacro-redefined]
#define SIZEOF_TIME_T 4
        ^
rrdtool-1.4.7/bindings/python/../../rrd_config.h:357:9: note: previous definition is here
#define SIZEOF_TIME_T 8
        ^
1 warning generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.11-intel-2.7/rrdtool-1.4.7/bindings/python/rrdtoolmodule.o -Lrrdtool-1.4.7/src/.libs -lrrd -o build/lib.macosx-10.11-intel-2.7/rrdtoolmodule.so
ld: warning: directory not found for option '-Lrrdtool-1.4.7/src/.libs'
ld: library not found for -lrrd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1

我试过很多次了,谁能告诉我

我通过@Stephen Ingram的建议解决了这个问题

1.安装rrdtool(使用
brew安装rrdtool

2.检查
cairo、pango

3.run
python setup.py安装

➜  python-rrdtool-1.4.7  sudo python setup.py install
running install
running build
running build_ext
running build_configure
building 'rrdtoolmodule' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Irrdtool-1.4.7/src -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c rrdtool-1.4.7/bindings/python/rrdtoolmodule.c -o build/temp.macosx-10.11-intel-2.7/rrdtool-1.4.7/bindings/python/rrdtoolmodule.o
rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:69:18: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    args_count = PyTuple_Size(args);
               ~ ^~~~~~~~~~~~~~~~~~
rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:375:15: warning: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    if ((ts = rrd_first(argc, argv)) == -1) {
            ~ ^~~~~~~~~~~~~~~~~~~~~
rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:400:15: warning: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    if ((ts = rrd_last(argc, argv)) == -1) {
            ~ ^~~~~~~~~~~~~~~~~~~~
3 warnings generated.
In file included from rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:44:
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8:
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:1062:9: warning: 'SIZEOF_TIME_T' macro redefined [-Wmacro-redefined]
#define SIZEOF_TIME_T 4
        ^
rrdtool-1.4.7/bindings/python/../../rrd_config.h:357:9: note: previous definition is here
#define SIZEOF_TIME_T 8
        ^
1 warning generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.11-intel-2.7/rrdtool-1.4.7/bindings/python/rrdtoolmodule.o -Lrrdtool-1.4.7/src/.libs -lrrd -o build/lib.macosx-10.11-intel-2.7/rrdtoolmodule.so
ld: warning: directory not found for option '-Lrrdtool-1.4.7/src/.libs'
ld: warning: directory not found for option '-Lrrdtool-1.4.7/src/.libs'
ld: warning: ignoring file /usr/local/lib/librrd.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/librrd.dylib
running install_lib
copying build/lib.macosx-10.11-intel-2.7/rrdtoolmodule.so -> /Library/Python/2.7/site-packages
running install_egg_info
Writing /Library/Python/2.7/site-packages/python_rrdtool-1.4.7-py2.7.egg-info

看起来它正在寻找需要先构建并安装rrdtool的rrd库。您是否尝试过
brew安装rrdtool
?我认为它应该同时安装rrd和python绑定。如果您不想使用
brew
,那么您可以先尝试从源代码构建,然后运行上面的pip命令。它可以工作。非常感谢。检查一下<代码>导入rrdtool您所说的检查cairo和pango是什么意思?