安装bcolz时如何解决clang'无效的部署目标'错误

时间:2019-01-08 06:51:02

标签: python python-3.x zipline bcolz

我想使用Python 3.5.4在Mac OS X Mojave(0.14.2(18C54))中安装zipline,但是每次编译器尝试通过{来安装bcolz时,安装都会失败{1}}。

我已经尝试将Xcode重新安装到最新版本(10.1),并且还从官方Apple Developer网站下载了最新的命令行工具,因为不再支持xcode-select -all命令。据我了解,pip install中的头文件是完整的,因此无需从我没有的先前版本中导入它们,也无需在Internet上其他位置进行搜索。

这是我的虚拟环境中的代码。通常,我会收到一个错误消息,即它无法找到头文件,这就是为什么我要指定CFLAGS来运行它的原因

Xcode.app/Contents/Developer/Files

和已安装软件包的列表

(zipline) ~ $CXXFLAGS="-std=libc++" CFLAGS="-std=libc++" pip install zipline
Collecting zipline
Requirement already satisfied: bottleneck>=1.0.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.0.0)
Requirement already satisfied: Mako>=1.0.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.0.7)
Requirement already satisfied: sortedcontainers>=1.4.4 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (2.1.0)
Requirement already satisfied: pip>=7.1.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (18.1)
Requirement already satisfied: requests-file>=1.4.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.4.1)
Requirement already satisfied: pandas<=0.22,>=0.18.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.18.1)
Requirement already satisfied: sqlalchemy>=1.0.8 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.2.15)
Requirement already satisfied: Logbook>=0.12.5 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.12.5)
Requirement already satisfied: patsy>=0.4.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.4.0)
Requirement already satisfied: statsmodels>=0.6.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.6.1)
Requirement already satisfied: six>=1.10.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.10.0)
Requirement already satisfied: empyrical>=0.5.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.5.0)
Requirement already satisfied: requests>=2.9.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (2.20.1)
Requirement already satisfied: numexpr>=2.6.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (2.6.1)
Requirement already satisfied: python-dateutil>=2.4.2 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (2.4.2)
Requirement already satisfied: alembic>=0.7.7 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.0.5)
Requirement already satisfied: pandas-datareader>=0.2.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.2.1)
Collecting bcolz<1,>=0.12.1 (from zipline)
  Using cached https://files.pythonhosted.org/packages/6c/8b/1ffa01f872cac36173c5eb95b58c01040d8d25f1b242c48577f4104cd3ab/bcolz-0.12.1.tar.gz
Requirement already satisfied: click>=4.0.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (7.0)
Requirement already satisfied: MarkupSafe>=0.23 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.1.0)
Requirement already satisfied: cyordereddict>=0.2.2 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.2.2)
Requirement already satisfied: setuptools>18.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (40.6.3)
Requirement already satisfied: intervaltree>=2.1.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (3.0.2)
Requirement already satisfied: lru-dict>=1.1.4 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.1.6)
Requirement already satisfied: numpy>=1.11.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.15.4)
Requirement already satisfied: networkx<2.0,>=1.9.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.9.1)
Requirement already satisfied: toolz>=0.8.2 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.9.0)
Requirement already satisfied: trading-calendars>=1.0.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (1.6.1)
Requirement already satisfied: pytz>=2016.4 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (2018.5)
Requirement already satisfied: contextlib2>=0.4.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.4.0)
Requirement already satisfied: Cython>=0.25.2 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.25.2)
Requirement already satisfied: tables>=3.3.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (3.4.4)
Requirement already satisfied: decorator>=4.0.0 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (4.0.0)
Requirement already satisfied: scipy>=0.17.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.17.1)
Requirement already satisfied: multipledispatch>=0.4.8 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from zipline) (0.6.0)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from requests>=2.9.1->zipline) (1.23)
Requirement already satisfied: certifi>=2017.4.17 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from requests>=2.9.1->zipline) (2018.8.24)
Requirement already satisfied: idna<2.8,>=2.5 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from requests>=2.9.1->zipline) (2.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from requests>=2.9.1->zipline) (3.0.4)
Requirement already satisfied: python-editor>=0.3 in ./.virtualenvs/zipline/lib/python3.5/site-packages (from alembic>=0.7.7->zipline) (1.0.3)
Building wheels for collected packages: bcolz
  Running setup.py bdist_wheel for bcolz ... error
  Complete output from command /Users/USERNAME/.virtualenvs/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-install-itawco06/bcolz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-wheel-1f24zwoi --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.6-intel-3.5
  creating build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/py2help_tests.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/version.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/toplevel.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/ctable.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/__init__.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/utils.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/chunked_eval.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/defaults.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/attrs.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/py2help.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  copying bcolz/arrayprint.py -> build/lib.macosx-10.6-intel-3.5/bcolz
  creating build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/test_ndcarray.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/test_carray_objects.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/test_attrs.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/__init__.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/all.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/common.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/test_queries.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/test_ctable.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/tests/test_carray.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
  copying bcolz/carray_ext.pxd -> build/lib.macosx-10.6-intel-3.5/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.5
  creating build/temp.macosx-10.6-intel-3.5/bcolz
  creating build/temp.macosx-10.6-intel-3.5/c-blosc
  creating build/temp.macosx-10.6-intel-3.5/c-blosc/blosc
  creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs
  creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs/lz4-r119
  creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs/snappy-1.1.1
  creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs/zlib-1.2.8
  /usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=libc++ -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/USERNAME/.virtualenvs/zipline/lib/python3.5/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c bcolz/carray_ext.c -o build/temp.macosx-10.6-intel-3.5/bcolz/carray_ext.o -std=libc++
  error: invalid value 'libc++' in '-std=libc++'
  note: use 'c89', 'c90', or 'iso9899:1990' for 'ISO C 1990' standard
  note: use 'iso9899:199409' for 'ISO C 1990 with amendment 1' standard
  note: use 'gnu89' or 'gnu90' for 'ISO C 1990 with GNU extensions' standard
  note: use 'c99' or 'iso9899:1999' for 'ISO C 1999' standard
  note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard
  note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard
  note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
  note: use 'c17' or 'iso9899:2017' for 'ISO C 2017' standard
  note: use 'gnu17' for 'ISO C 2017 with GNU extensions' standard
  error: command '/usr/bin/clang' failed with exit status 1

  ----------------------------------------
  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/USERNAME/.virtualenvs/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-install-itawco06/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 /private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-record-a3h6zh7b/install-record.txt --single-version-externally-managed --compile --install-headers /Users/USERNAME/.virtualenvs/zipline/bin/../include/site/python3.5/bcolz:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.5
    creating build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/py2help_tests.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/version.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/toplevel.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/ctable.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/__init__.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/utils.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/chunked_eval.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/defaults.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/attrs.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/py2help.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    copying bcolz/arrayprint.py -> build/lib.macosx-10.6-intel-3.5/bcolz
    creating build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/test_ndcarray.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/test_carray_objects.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/test_attrs.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/__init__.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/all.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/common.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/test_queries.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/test_ctable.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/tests/test_carray.py -> build/lib.macosx-10.6-intel-3.5/bcolz/tests
    copying bcolz/carray_ext.pxd -> build/lib.macosx-10.6-intel-3.5/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.5
    creating build/temp.macosx-10.6-intel-3.5/bcolz
    creating build/temp.macosx-10.6-intel-3.5/c-blosc
    creating build/temp.macosx-10.6-intel-3.5/c-blosc/blosc
    creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs
    creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs/lz4-r119
    creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs/snappy-1.1.1
    creating build/temp.macosx-10.6-intel-3.5/c-blosc/internal-complibs/zlib-1.2.8
    /usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=libc++ -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/USERNAME/.virtualenvs/zipline/lib/python3.5/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c bcolz/carray_ext.c -o build/temp.macosx-10.6-intel-3.5/bcolz/carray_ext.o -std=libc++
    error: invalid value 'libc++' in '-std=libc++'
    note: use 'c89', 'c90', or 'iso9899:1990' for 'ISO C 1990' standard
    note: use 'iso9899:199409' for 'ISO C 1990 with amendment 1' standard
    note: use 'gnu89' or 'gnu90' for 'ISO C 1990 with GNU extensions' standard
    note: use 'c99' or 'iso9899:1999' for 'ISO C 1999' standard
    note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard
    note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard
    note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
    note: use 'c17' or 'iso9899:2017' for 'ISO C 2017' standard
    note: use 'gnu17' for 'ISO C 2017 with GNU extensions' standard
    error: command '/usr/bin/clang' failed with exit status 1

    ----------------------------------------
Command "/Users/USERNAME/.virtualenvs/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-install-itawco06/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 /private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-record-a3h6zh7b/install-record.txt --single-version-externally-managed --compile --install-headers /Users/USERNAME/.virtualenvs/zipline/bin/../include/site/python3.5/bcolz" failed with error code 1 in /private/var/folders/5k/2m1pt8j91nbfjjjcjvrlxjpc0000gn/T/pip-install-itawco06/bcolz/

最佳的结果是使整个程序包运行起来,因为我已经在网上搜索了一个多星期,并在不同的python版本上尝试了各种解决方案。 任何帮助将不胜感激。

0 个答案:

没有答案