simstring模块的安装失败

时间:2015-07-21 14:00:39

标签: python-2.7 python-3.x anaconda python-module spyder

我想使用可下载的源代码安装simstring包进行近似字符串检索。到目前为止,我只安装了easy_install的软件包。这是我第一次尝试从安装文件安装模块......我失败了,为什么?

$ Users/./Downloads/simstring-1.0/swig/python/setup.py.in build_ext --inplace
    running build_ext
    building '_simstring' extension
    g++ -fno-strict-aliasing -I//anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/./Downloads/simstring-1.0/include -I//anaconda/include/python2.7 -c export.cpp -o build/temp.macosx-10.5-x86_64-2.7/export.o
    clang: error: no such file or directory: 'export.cpp'
    clang: error: no input files
    error: command 'g++' failed with exit status 1

编辑:23.06.2015

对Python 3.4和新Xcode7的新尝试。我收到的错误列表很长。我如何修复g ++编译器?

$ python3 setup.py build_ext 
running build_ext
building '_simstring' extension
g++ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Users/.../Downloads/simstring-1.0/include -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c export.cpp -o build/temp.macosx-10.6-intel-3.4/export.o
g++ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Users/.../Downloads/simstring-1.0/include -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c export_wrap.cpp -o build/temp.macosx-10.6-intel-3.4/export_wrap.o
export_wrap.cpp:883:33: error: use of undeclared identifier 'PyString_AsString'
    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
                                ^
export_wrap.cpp:1274:9: error: use of undeclared identifier 'PyClass_Check'
    if (PyClass_Check(obj)) {
        ^
export_wrap.cpp:1347:24: error: use of undeclared identifier
      'PyString_FromString'
      PyObject *ofmt = PyString_FromString(fmt);
                       ^
export_wrap.cpp:1349:8: error: use of undeclared identifier 'PyString_Format'
        res = PyString_Format(ofmt,args);
              ^
export_wrap.cpp:1379:84: error: use of undeclared identifier 'PyString_AsString'
  ...PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString...
                                                                     ^
export_wrap.cpp:1387:5: error: use of undeclared identifier
      'PyString_ConcatAndDel'; did you mean 'PyBytes_ConcatAndDel'?
    PyString_ConcatAndDel(&repr,nrep);
    ^~~~~~~~~~~~~~~~~~~~~
    PyBytes_ConcatAndDel
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/bytesobject.h:62:18: note: 
      'PyBytes_ConcatAndDel' declared here
PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
                 ^
export_wrap.cpp:1401:11: error: use of undeclared identifier 'PyString_AsString'
    fputs(PyString_AsString(repr), fp);
          ^
export_wrap.cpp:1414:5: error: use of undeclared identifier
      'PyString_FromString'
    PyString_FromString(result) : 0;
    ^
export_wrap.cpp:1623:6: error: use of undeclared identifier 'coercion'
    (coercion)0,   /*nb_coerce*/
     ^
export_wrap.cpp:1656:3: error: use of undeclared identifier 'cmpfunc'
        (cmpfunc)PySwigObject_compare,      /* tp_compare */ 
         ^
export_wrap.cpp:1703:23: error: no member named 'ob_type' in '_typeobject'
    pyswigobject_type.ob_type = &PyType_Type;
    ~~~~~~~~~~~~~~~~~ ^
export_wrap.cpp:1752:12: error: use of undeclared identifier
      'PyString_FromFormat'
    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
           ^
export_wrap.cpp:1754:12: error: use of undeclared identifier
      'PyString_FromFormat'
    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
           ^
export_wrap.cpp:1763:12: error: use of undeclared identifier
      'PyString_FromFormat'
    return PyString_FromFormat("%s%s", result, v->ty->name);
           ^
export_wrap.cpp:1765:12: error: use of undeclared identifier
      'PyString_FromString'
    return PyString_FromString(v->ty->name);
           ^
export_wrap.cpp:1819:3: error: use of undeclared identifier 'cmpfunc'
        (cmpfunc)PySwigPacked_compare,      /* tp_compare */    
         ^
export_wrap.cpp:1866:23: error: no member named 'ob_type' in '_typeobject'
    pyswigpacked_type.ob_type = &PyType_Type;
    ~~~~~~~~~~~~~~~~~ ^
export_wrap.cpp:1911:10: error: use of undeclared identifier
      'PyString_FromString'
  return PyString_FromString("this");
         ^
export_wrap.cpp:1931:9: error: use of undeclared identifier 'PyInstance_Check';
      did you mean 'PySequence_Check'?
    if (PyInstance_Check(pyobj)) {
        ^~~~~~~~~~~~~~~~
        PySequence_Check
/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/abstract.h:923:22: note: 
      'PySequence_Check' declared here
     PyAPI_FUNC(int) PySequence_Check(PyObject *o);
                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'g++' failed with exit status 1 

0 个答案:

没有答案