如何在python 3.7中的软件包安装(fcm)期间修复gcc错误

时间:2019-07-17 11:49:12

标签: python gcc install c-strings

最近的python用户,我正在尝试使用fcm模块来分析流式细胞仪数据(https://pythonhosted.org/fcm/)。我在安装pip时发现了与“ gcc”相关的错误。

尝试更新pip和setuptools,还按照How to fix gcc error produced by pip install?中的建议安装了brew和openssl,仍然发现相同的错误。

终端输出如下:

Collecting fcm

  Downloading https://files.pythonhosted.org/packages/b8/50/92e6fcf82b3411def7c5c08a1b9be5fc4d5f4a4ae8eb7c95ee4b0485fbdd/fcm-0.9.1.tar.gz (1.1MB)
    100% |████████████████████████████████| 1.1MB 12.9MB/s

Installing collected packages: fcm

  Running setup.py install for fcm ... error

    Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-install-424k_8e4/fcm/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-record-43efnrvl/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.7
    creating build/lib.macosx-10.7-x86_64-3.7/fcm
    copying src/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/transforms.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/tree.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/annotation.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/fcmdata.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/logicle.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/compensate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/gate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/fcmcollection.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/fcmexceptions.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/subsample.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/plot.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/experimental.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/plot_gate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/util.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/dimechart.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    copying src/gui/mpl_qgate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    copying src/gui/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    copying src/gui/mpl_gate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/flowjoxml.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/export_to_fcs.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/readfcs.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/mvnpdf.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/partition.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/util.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/modelresult.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/kmeans.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/dime.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/distributions.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/cluster.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/dp_cluster.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/component.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    running build_ext
    building 'fcm.core._logicle' extension
    creating build/temp.macosx-10.7-x86_64-3.7
    creating build/temp.macosx-10.7-x86_64-3.7/src
    creating build/temp.macosx-10.7-x86_64-3.7/src/core
    creating build/temp.macosx-10.7-x86_64-3.7/src/core/logicle_ext
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/anaconda3/include/python3.7m -c src/core/logicle_ext/Logicle.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/core/logicle_ext/Logicle.o
    warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    src/core/logicle_ext/Logicle.cpp:3:10: fatal error: 'cstring' file not found
    #include <cstring>
             ^~~~~~~~~
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-install-424k_8e4/fcm/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-record-43efnrvl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-install-424k_8e4/fcm/

我感谢任何其他建议

编辑:安装命令行工具并导出-stdlib=libc++

之后
Downloading https://files.pythonhosted.org/packages/b8/50/92e6fcf82b3411def7c5c08a1b9be5fc4d5f4a4ae8eb7c95ee4b0485fbdd/fcm-0.9.1.tar.gz (1.1MB)
    100% |████████████████████████████████| 1.1MB 13.3MB/s 
Installing collected packages: fcm
  Running setup.py install for fcm ... error
    Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-install-p_ehtvg8/fcm/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-record-4xk1zm47/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.7
    creating build/lib.macosx-10.7-x86_64-3.7/fcm
    copying src/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/transforms.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/tree.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/annotation.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/fcmdata.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/logicle.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/compensate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/gate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/fcmcollection.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/fcmexceptions.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    copying src/core/subsample.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/core
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/plot.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/experimental.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/plot_gate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/util.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    copying src/graphics/dimechart.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/graphics
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    copying src/gui/mpl_qgate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    copying src/gui/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    copying src/gui/mpl_gate.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/gui
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/flowjoxml.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/export_to_fcs.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    copying src/io/readfcs.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/io
    creating build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/mvnpdf.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/partition.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/util.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/modelresult.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/kmeans.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/dime.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/distributions.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/cluster.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/dp_cluster.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    copying src/statistics/component.py -> build/lib.macosx-10.7-x86_64-3.7/fcm/statistics
    running build_ext
    building 'fcm.core._logicle' extension
    creating build/temp.macosx-10.7-x86_64-3.7
    creating build/temp.macosx-10.7-x86_64-3.7/src
    creating build/temp.macosx-10.7-x86_64-3.7/src/core
    creating build/temp.macosx-10.7-x86_64-3.7/src/core/logicle_ext
    gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -stdlib=libc++ -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/anaconda3/include/python3.7m -c src/core/logicle_ext/Logicle.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/core/logicle_ext/Logicle.o
    src/core/logicle_ext/Logicle.cpp:290:4: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                            else
                            ^
    1 warning generated.
    gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -stdlib=libc++ -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/anaconda3/include/python3.7m -c src/core/logicle_ext/my_logicle.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/core/logicle_ext/my_logicle.o
    gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -stdlib=libc++ -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/anaconda3/include/python3.7m -c src/core/logicle_ext/my_logicle_wrapper.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/core/logicle_ext/my_logicle_wrapper.o
    src/core/logicle_ext/my_logicle_wrapper.cpp:788:3: error: no matching function for call to 'PyBytes_AsStringAndSize'
      PyBytes_AsStringAndSize(str, &cstr, &len);
      ^~~~~~~~~~~~~~~~~~~~~~~
    /anaconda3/include/python3.7m/bytesobject.h:103:17: note: candidate function not viable: no known conversion from 'int *' to 'Py_ssize_t *' (aka 'long *') for 3rd argument
    PyAPI_FUNC(int) PyBytes_AsStringAndSize(
                    ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2229:11: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
                        res = SWIG_AddCast(res);
                        ~~~ ^              ~~~
    src/core/logicle_ext/my_logicle_wrapper.cpp:2232:11: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
                        res = SWIG_AddCast(res);
                        ~~~ ^              ~~~
    src/core/logicle_ext/my_logicle_wrapper.cpp:2454:20: error: use of undeclared identifier 'PyCObject_Import'; did you mean 'PyObject_Init'?
        type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
                       ^~~~~~~~~~~~~~~~
                       PyObject_Init
    /anaconda3/include/python3.7m/objimpl.h:130:24: note: 'PyObject_Init' declared here
    PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
                           ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2454:37: error: cannot initialize a parameter of type 'PyObject *' (aka '_object *') with an rvalue of type 'char *'
        type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /anaconda3/include/python3.7m/objimpl.h:130:48: note: passing argument to parameter here
    PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
                                                   ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2524:23: error: use of undeclared identifier 'PyCObject_FromVoidPtr'
      PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
                          ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2547:37: error: use of undeclared identifier 'PyCObject_AsVoidPtr'
        descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
                                        ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2552:13: error: use of undeclared identifier 'PyCObject_FromVoidPtr'
          obj = PyCObject_FromVoidPtr(descriptor, NULL);
                ^
    In file included from src/core/logicle_ext/my_logicle_wrapper.cpp:2800:
    In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
    In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
    /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2919:9: error: use of undeclared identifier 'PyString_Check'; did you mean 'PyMapping_Check'?
        if (PyString_Check(  py_obj)) return "string"      ;
            ^~~~~~~~~~~~~~
            PyMapping_Check
    /anaconda3/include/python3.7m/abstract.h:1006:17: note: 'PyMapping_Check' declared here
    PyAPI_FUNC(int) PyMapping_Check(PyObject *o);
                    ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2925:9: error: use of undeclared identifier 'PyFile_Check'
        if (PyFile_Check(    py_obj)) return "file"        ;
            ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:2927:9: error: use of undeclared identifier 'PyInstance_Check'; did you mean 'PySequence_Check'?
        if (PyInstance_Check(py_obj)) return "instance"    ;
            ^~~~~~~~~~~~~~~~
            PySequence_Check
    /anaconda3/include/python3.7m/abstract.h:838:17: note: 'PySequence_Check' declared here
    PyAPI_FUNC(int) PySequence_Check(PyObject *o);
                    ^
    src/core/logicle_ext/my_logicle_wrapper.cpp:3435:14: warning: explicitly assigning value of variable of type 'void *' to itself [-Wself-assign]
      clientdata = clientdata;
      ~~~~~~~~~~ ^ ~~~~~~~~~~
    4 warnings and 9 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-install-p_ehtvg8/fcm/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-record-4xk1zm47/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/kt/54_zwpj929b852yth43_hj440000gn/T/pip-install-p_ehtvg8/fcm/

2 个答案:

答案 0 :(得分:0)

如果您尝试为'django'安装'fcm',则可以通过

    pip install django-fcm

答案 1 :(得分:0)

我是FCM代码库的维护者,在原始作者毕业后继承。 FCM旨在支持分层Dirichlet流程(HDP)聚类算法。我最终决定将功能分成3个不同的库:

  • FlowIO:对于那些只需要读取FCS数据或创建新的FCS文件的人
  • FlowUtils:用于执行基本流函数(补偿和变换)
  • FlowStats:适用于希望使用特定HDP群集算法的人

自上一版FCM以来,所有这些都取得了长足的发展。除此之外,我们最近还开始在FlowKit上进行开发,它有望成为用于流式细胞术分析和可视化的更高级,(更希望是)更直观的Python框架,包括GatingML支持。

请注意,FlowIO,FlowUtils和FlowKit在PyPI上,可以通过pip安装,并且由于减少了依赖性和最近的错误修复,因此与所有平台(包括Windows,Mac和Linux)兼容。