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
一個安裝python包的有用工具是Enthought。如果你有學校的電子郵件地址,安裝是免費的。 – cosmosis