0

我正在尝试在 OS X Lion 上安装 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
4

1 回答 1

0

我看到你正在使用 PyPy - 它不支持 matplotlib(至少现在)。改用默认的 python (CPython) 会更好。

于 2012-07-05T13:29:39.393 回答