zipline 安装错误:bcolz 构建轮子失败

Hye*_*hoi 2 python pip zipline bcolz

我正在尝试在 mac os 上的虚拟环境中安装 zipline。

Python 版本 = 3.6 / numpy、预装 cython

当我尝试pip install zipline虚拟环境时,出现以下错误。(控制台上打印出很多警告,但我认为下面的警告是我的问题的关键)

1 warning and 1 error generated.
  error: command '/usr/bin/clang' failed with exit status 1

  ----------------------------------------
  Failed building wheel for bcolz
Run Code Online (Sandbox Code Playgroud)

我尝试安装 bcolz,但似乎没有解决问题。我很感激解决方案。

提前致谢!

编辑 :

错误代码太长,超出了控制台范围。这是最后几行的一些错误。

 31 warnings generated.
    In file included from bcolz/carray_ext.c:242:
    In file included from /Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
    In file included from /Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
    /Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it by " \
     ^
    bcolz/carray_ext.c:43580:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
    static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
                                   ^
    bcolz/carray_ext.c:40725:26: warning: unused function '__Pyx_PyBytes_Equals' [-Wunused-function]
    static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
                             ^
    bcolz/carray_ext.c:40908:32: warning: unused function '__Pyx_GetItemInt_List_Fast' [-Wunused-function]
    static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                   ^
    bcolz/carray_ext.c:40923:32: warning: unused function '__Pyx_GetItemInt_Tuple_Fast' [-Wunused-function]
    static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                   ^
    bcolz/carray_ext.c:43162:32: warning: unused function '__Pyx_PyInt_From_char' [-Wunused-function]
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
                                   ^
    bcolz/carray_ext.c:43199:48: warning: unused function '__pyx_t_float_complex_from_parts' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
                                                   ^
    bcolz/carray_ext.c:43209:30: warning: unused function '__Pyx_c_eqf' [-Wunused-function]
        static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
                                 ^
    bcolz/carray_ext.c:43212:48: warning: unused function '__Pyx_c_sumf' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
                                                   ^
    bcolz/carray_ext.c:43218:48: warning: unused function '__Pyx_c_difff' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
                                                   ^
    bcolz/carray_ext.c:43230:48: warning: unused function '__Pyx_c_quotf' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
                                                   ^
    bcolz/carray_ext.c:43237:48: warning: unused function '__Pyx_c_negf' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
                                                   ^
    bcolz/carray_ext.c:43243:30: warning: unused function '__Pyx_c_is_zerof' [-Wunused-function]
        static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
                                 ^
    bcolz/carray_ext.c:43246:48: warning: unused function '__Pyx_c_conjf' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
                                                   ^
    bcolz/carray_ext.c:43260:52: warning: unused function '__Pyx_c_powf' [-Wunused-function]
            static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
                                                       ^
    bcolz/carray_ext.c:43319:49: warning: unused function '__pyx_t_double_complex_from_parts' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
                                                    ^
    bcolz/carray_ext.c:43329:30: warning: unused function '__Pyx_c_eq' [-Wunused-function]
        static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
                                 ^
    bcolz/carray_ext.c:43332:49: warning: unused function '__Pyx_c_sum' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
                                                    ^
    bcolz/carray_ext.c:43338:49: warning: unused function '__Pyx_c_diff' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
                                                    ^
    bcolz/carray_ext.c:43350:49: warning: unused function '__Pyx_c_quot' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
                                                    ^
    bcolz/carray_ext.c:43357:49: warning: unused function '__Pyx_c_neg' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
                                                    ^
    bcolz/carray_ext.c:43363:30: warning: unused function '__Pyx_c_is_zero' [-Wunused-function]
        static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
                                 ^
    bcolz/carray_ext.c:43366:49: warning: unused function '__Pyx_c_conj' [-Wunused-function]
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
                                                    ^
    bcolz/carray_ext.c:43380:53: warning: unused function '__Pyx_c_pow' [-Wunused-function]
            static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
                                                        ^
    bcolz/carray_ext.c:35492:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew1' [-Wunused-function]
    static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
                                   ^
    bcolz/carray_ext.c:35542:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew2' [-Wunused-function]
    static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
                                   ^
    bcolz/carray_ext.c:35592:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew3' [-Wunused-function]
    static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
                                   ^
    bcolz/carray_ext.c:35642:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew4' [-Wunused-function]
    static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
                                   ^
    bcolz/carray_ext.c:35692:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew5' [-Wunused-function]
    static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
                                   ^
    bcolz/carray_ext.c:36500:27: warning: unused function '__pyx_f_5numpy_set_array_base' [-Wunused-function]
    static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
                              ^
    bcolz/carray_ext.c:36596:32: warning: unused function '__pyx_f_5numpy_get_array_base' [-Wunused-function]
    static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
                                   ^
    31 warnings generated.
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -Ic-blosc/internal-complibs/zlib-1.2.8 -I/Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c c-blosc/blosc/blosc.c -o build/temp.macosx-10.6-intel-3.6/c-blosc/blosc/blosc.o
    In file included from c-blosc/blosc/blosc.c:24:
    c-blosc/internal-complibs/lz4-r119/lz4.h:179:23: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStream();
                          ^
                           void
    c-blosc/internal-complibs/lz4-r119/lz4.h:237:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStreamDecode();
                                ^
                                 void
    2 warnings generated.
    In file included from c-blosc/blosc/blosc.c:24:
    c-blosc/internal-complibs/lz4-r119/lz4.h:179:23: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStream();
                          ^
                           void
    c-blosc/internal-complibs/lz4-r119/lz4.h:237:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStreamDecode();
                                ^
                                 void
    2 warnings generated.
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -Ic-blosc/internal-complibs/zlib-1.2.8 -I/Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c c-blosc/blosc/shuffle.c -o build/temp.macosx-10.6-intel-3.6/c-blosc/blosc/shuffle.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -Ic-blosc/internal-complibs/zlib-1.2.8 -I/Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c c-blosc/blosc/blosclz.c -o build/temp.macosx-10.6-intel-3.6/c-blosc/blosc/blosclz.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -Ic-blosc/internal-complibs/zlib-1.2.8 -I/Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c c-blosc/internal-complibs/lz4-r119/lz4hc.c -o build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs/lz4-r119/lz4hc.o
    In file included from c-blosc/internal-complibs/lz4-r119/lz4hc.c:142:
    c-blosc/internal-complibs/lz4-r119/lz4.h:179:23: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStream();
                          ^
                           void
    c-blosc/internal-complibs/lz4-r119/lz4.h:237:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStreamDecode();
                                ^
                                 void
    2 warnings generated.
    In file included from c-blosc/internal-complibs/lz4-r119/lz4hc.c:142:
    c-blosc/internal-complibs/lz4-r119/lz4.h:179:23: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStream();
                          ^
                           void
    c-blosc/internal-complibs/lz4-r119/lz4.h:237:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStreamDecode();
                                ^
                                 void
    2 warnings generated.
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -Ic-blosc/internal-complibs/zlib-1.2.8 -I/Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c c-blosc/internal-complibs/lz4-r119/lz4.c -o build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs/lz4-r119/lz4.o
    In file included from c-blosc/internal-complibs/lz4-r119/lz4.c:163:
    c-blosc/internal-complibs/lz4-r119/lz4.h:179:23: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStream();
                          ^
                           void
    c-blosc/internal-complibs/lz4-r119/lz4.h:237:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStreamDecode();
                                ^
                                 void
    2 warnings generated.
    In file included from c-blosc/internal-complibs/lz4-r119/lz4.c:163:
    c-blosc/internal-complibs/lz4-r119/lz4.h:179:23: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStream();
                          ^
                           void
    c-blosc/internal-complibs/lz4-r119/lz4.h:237:29: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    void* LZ4_createStreamDecode();
                                ^
                                 void
    2 warnings generated.
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -Ic-blosc/internal-complibs/zlib-1.2.8 -I/Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c c-blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.cc -o build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    c-blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.cc:29:10: fatal error: 'algorithm' file not found
    #include <algorithm>
             ^~~~~~~~~~~
    1 warning and 1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

尝试 CXXFLAGS="-std=libc++" CFLAGS="-std=libc++" CC="clang++" pip install zipline 后编辑 2:它仍然失败。

  Failed building wheel for bcolz
  Running setup.py clean for bcolz
Failed to build bcolz
Installing collected packages: bcolz, zipline
  Running setup.py install for bcolz ... error
    Complete output from command /Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/n5/yqd1_zh15xz55dy2qzsjxzfr0000gn/T/pip-build-beuburui/bcolz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/n5/yqd1_zh15xz55dy2qzsjxzfr0000gn/T/pip-b2puzll6-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/choehyeong-gyu/PycharmProjects/CubicHill/venv/bin/../include/site/python3.6/bcolz:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.6
    creating build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/py2help_tests.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/version.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/toplevel.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/ctable.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/__init__.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/utils.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/chunked_eval.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/defaults.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/attrs.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/py2help.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    copying bcolz/arrayprint.py -> build/lib.macosx-10.6-intel-3.6/bcolz
    creating build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/test_ndcarray.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/test_carray_objects.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/test_attrs.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/__init__.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/all.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/common.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/test_queries.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/test_ctable.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/tests/test_carray.py -> build/lib.macosx-10.6-intel-3.6/bcolz/tests
    copying bcolz/carray_ext.pxd -> build/lib.macosx-10.6-intel-3.6/bcolz
    running build_ext
    skipping 'bcolz/carray_ext.c' Cython extension (up-to-date)
    building 'bcolz.carray_ext' extension
    creating build/temp.macosx-10.6-intel-3.6
    creating build/temp.macosx-10.6-intel-3.6/bcolz
    creating build/temp.macosx-10.6-intel-3.6/c-blosc
    creating build/temp.macosx-10.6-intel-3.6/c-blosc/blosc
    creating build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs
    creating build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs/lz4-r119
    creating build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs/snappy-1.1.1
    creating build/temp.macosx-10.6-intel-3.6/c-blosc/internal-complibs/zlib-1.2.8
    clang++ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=libc++ -DHAVE_L