错误:命令"gcc"失败,退出状态为1致命错误:找不到"vector"文件 [英] error: command 'gcc' failed with exit status 1 fatal error: 'vector' file not found

查看:534
本文介绍了错误:命令"gcc"失败,退出状态为1致命错误:找不到"vector"文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I ran pip install annoy and got the following error:

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进行编译?我该怎么办?

From reading other stackoverflow answers, I should compile with g++ rather than gcc? How do I do that?

推荐答案

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

I should compile with g++ rather than gcc : visibly yes, #include <vector> is typically C++, not C

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

The way to install g++ depend on the platform/OS you use

这篇关于错误:命令"gcc"失败,退出状态为1致命错误:找不到"vector"文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆