简体   繁体   English

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

[英]How to fix gcc error during package install (fcm) in python 3.7

Recent python user, I am trying to use fcm module to analyze flow cytometry data ( https://pythonhosted.org/fcm/ ). 最近使用python的用户,我正在尝试使用fcm模块来分析流式细胞仪数据( https://pythonhosted.org/fcm/ )。 I find an error related to 'gcc' during pip install. 我在pip安装过程中发现与“ gcc”相关的错误。

Tried updating pip and setuptools, also installed brew and openssl as suggested in How to fix gcc error produced by pip install? 尝试更新pip和setuptools,还按照如何修复pip安装产生的gcc错误中的建议安装了brew和openssl , still finding the same error. ,仍然发现相同的错误。

The terminal output is the following: 终端输出如下:

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/

I appreciate any further advice 我感谢任何进一步的建议

Edit: After installing Command Line Tools and exporting -stdlib=libc++ 编辑:安装命令行工具并导出-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/

如果您要为“ django”安装“ fcm”,则可以通过

    pip install django-fcm

I am the maintainer of the FCM codebase, inherited after the original author graduated. 我是FCM代码库的维护者,在原始作者毕业后继承。 FCM was developed to support an hierarchical Dirichlet process (HDP) clustering algorithm. FCM旨在支持分层Dirichlet流程(HDP)聚类算法。 I eventually decided to separate the functionality into 3 different libraries: 我最终决定将功能分成3个不同的库:

  • FlowIO : for those that simply need to read FCS data or create new FCS files FlowIO :对于那些只需要读取FCS数据或创建新的FCS文件的用户
  • FlowUtils : for performing basic flow functions (compensation & transforms) FlowUtils :用于执行基本流量功能(补偿和转换)
  • FlowStats : for those looking to use the specific HDP clustering algorithm FlowStats :适用于希望使用特定HDP聚类算法的用户

All of these have seen significant development since the last version of FCM. 自从上一版FCM以来,所有这些都取得了长足的发展。 In addition to these, we've recently started development on FlowKit , which promises to be a more high-level and (hopefully) more intuitive Python framework for flow cytometry analysis and visualization, including GatingML support. 除此之外,我们最近还开始在FlowKit上进行开发 ,该工具有望成为用于流式细胞术分析和可视化的更高级和(希望)更直观的Python框架,包括GatingML支持。

Note that FlowIO, FlowUtils, and FlowKit are on PyPI and available to install via pip, and are compatible with all platforms including Windows, Mac, and Linux due to the reduced number of dependencies and recent bug fixes. 请注意,FlowIO,FlowUtils和FlowKit在PyPI上,可以通过pip安装,并且由于减少了依赖性和最近的错误修复,因此与所有平台(包括Windows,Mac和Linux)兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM