错误:命令“ gcc”失败,退出状态为1致命错误:找不到“矢量”文件

时间:2019-01-03 17:48:52

标签: gcc pip annoy

我烦人pip install并出现以下错误:

Collecting annoy
  Using cached https://files.pythonhosted.org/packages/b5/28/f8ce7400344090bb5cfa1c9fae3fdb03b9438db082d458686442633d82a3/annoy-1.15.0.tar.gz
Building wheels for collected packages: annoy
  Running setup.py bdist_wheel for annoy ... error
  Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/pip-build-h3hirwtn/annoy/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 /var/folders/yp/4w8nvxls4y99r68kpxzzwdl00000gn/T/tmpdqliidvopip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.6-x86_64-3.6
  creating build/lib.macosx-10.6-x86_64-3.6/annoy
  copying annoy/__init__.py -> build/lib.macosx-10.6-x86_64-3.6/annoy
  running build_ext
  building 'annoy.annoylib' extension
  creating build/temp.macosx-10.6-x86_64-3.6
  creating build/temp.macosx-10.6-x86_64-3.6/src
  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/include/python3.6m -c src/annoymodule.cc -o build/temp.macosx-10.6-x86_64-3.6/src/annoymodule.o -O3 -ffast-math -fno-associative-math -march=native
  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]
  In file included from src/annoymodule.cc:15:
  src/annoylib.h:49:10: fatal error: 'vector' file not found
  #include <vector>
           ^~~~~~~~
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1

通过阅读其他stackoverflow答案,我应该使用g ++而不是gcc进行编译?我该怎么办?

1 个答案:

答案 0 :(得分:0)

我应该使用g ++而不是gcc 进行编译:显然,#include <vector>通常是C ++,而不是C

安装g ++的方式取决于您使用的平台/操作系统