在Lion编译错误时安装matplotlib

2024-04-28 17:50:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在OSXLion上安装matplotlib(+numpy,pandas等),但它似乎不能正常构建。我正在按照指示操作:http://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/,但没有这样的运气。在

整个输出相当长,所以我把它放在这里:http://pastebin.com/ab6E1AB2

重要的是:

In file included from ./CXX/Python2/Extensions.hxx:52:
./CXX/Python2/Objects.hxx:1052:17: error: no matching function for call to
      '_PyComplex_FromCComplex'
            set(PyComplex_FromCComplex (v), true);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/complexobject.h:24:35: note: expanded from macro
      'PyComplex_FromCComplex'
#define PyComplex_FromCComplex(c) _PyComplex_FromCComplex(&c)
                                  ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pypy_decl.h:488:24: note: candidate function not viable: 1st
      argument ('const Py_complex *' (aka 'const Py_complex_t *')) would lose
      const qualifier
PyAPI_FUNC(PyObject *) _PyComplex_FromCComplex(Py_complex *arg0);
                       ^
In file included from src/ft2font.cpp:3:
In file included from src/ft2font.h:6:
In file included from ./CXX/Extensions.hxx:40:
In file included from ./CXX/Python2/Extensions.hxx:52:
./CXX/Python2/Objects.hxx:2215:32: error: no matching function for call to
      'PyString_AsEncodedObject'
                return String( PyString_AsEncodedObject( ptr(), ...
                               ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pypy_decl.h:363:24: note: candidate function not viable: 2nd
      argument ('const char *') would lose const qualifier
PyAPI_FUNC(PyObject *) PyString_AsEncodedObject(PyObject *arg0, char ...
                       ^
In file included from src/ft2font.cpp:3:
In file included from src/ft2font.h:6:
In file included from ./CXX/Extensions.hxx:40:
In file included from ./CXX/Python2/Extensions.hxx:52:
./CXX/Python2/Objects.hxx:2221:28: error: no matching function for call to
      'PyString_AsDecodedObject'
            return Object( PyString_AsDecodedObject( ptr(), encoding, ...
                           ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pypy_decl.h:362:24: note: candidate function not viable: 2nd
      argument ('const char *') would lose const qualifier
PyAPI_FUNC(PyObject *) PyString_AsDecodedObject(PyObject *arg0, char ...
                       ^
In file included from src/ft2font.cpp:3:
In file included from src/ft2font.h:6:
In file included from ./CXX/Extensions.hxx:40:
In file included from ./CXX/Python2/Extensions.hxx:52:
./CXX/Python2/Objects.hxx:3311:12: error: use of undeclared identifier
      'PyNumber_Coerce'; did you mean 'PyNumber_Check'?
        if(PyNumber_Coerce(&p1,&p2) == -1)
           ^~~~~~~~~~~~~~~
           PyNumber_Check
/usr/local/include/pypy_decl.h:239:17: note: 'PyNumber_Check' declared here
PyAPI_FUNC(int) PyNumber_Check(PyObject *arg0);
                ^
In file included from src/ft2font.cpp:3:
In file included from src/ft2font.h:6:
In file included from ./CXX/Extensions.hxx:40:
In file included from ./CXX/Python2/Extensions.hxx:52:
./CXX/Python2/Objects.hxx:3311:32: error: too many arguments to function call,
      expected 1, have 2
        if(PyNumber_Coerce(&p1,&p2) == -1)
           ~~~~~~~~~~~~~~~     ^~~
/usr/local/include/pypy_decl.h:239:12: note: 'PyNumber_Check' declared here
PyAPI_FUNC(int) PyNumber_Check(PyObject *arg0);
           ^
/usr/local/include/Python.h:14:28: note: expanded from macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
                           ^
5 errors generated.
error: command '/usr/bin/clang' failed with exit status 1

Tags: infromsrcincludeusrlocalcxxfunction