2012-06-30 137 views
0

我想在OS X Lion上安装matplotlib(+ numpy,pandas等),它似乎没有正确构建。我遵循以下指示:http://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/没有这样的运气。在Lion上安装matplotlib编译错误

整个输出相当长,所以我在这里张贴: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 
+0

一个安装python包的有用工具是Enthought。如果你有学校的电子邮件地址,安装是免费的。 – cosmosis

回答

0

我看你使用PyPy - 它不支持matplotlib(至少然而)。您可以使用默认的python(CPython)来获得更好的运气。