【发布时间】:2023-07-16 22:22:01
【问题描述】:
我想用 python 来处理 rrd ,但是当我是 pip install 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
我试过很多次了,谁能告诉我?
【问题讨论】:
-
它似乎正在寻找需要首先构建和安装 rrdtool 的 rrd 库。你试过
brew install rrdtool吗?我相信它应该一起安装 rrd 和 python 绑定。如果你不想使用brew,那么你可以先尝试从源代码构建,然后运行上面的 pip 命令。 -
它有效。非常感谢。