我正在尝试安装 Biopython,但出现此错误:
> gdr$ python setup.py build running build running build_py running
> build_ext building 'Bio.cpairwise2' extension gcc -DNDEBUG -g -fwrapv
> -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Applications/Canopy.app/appdata/canopy-1.7.2.3327.macosx-x86_64/Canopy.app/Contents/include/python2.7
> -c Bio/cpairwise2module.c -o build/temp.macosx-10.6-x86_64-2.7/Bio/cpairwise2module.o gcc: error:
> unrecognized command line option ‘-Qunused-arguments’ gcc: error:
> unrecognized command line option ‘-Qunused-arguments’ error: command
> 'gcc' failed with exit status 1
我运行的是 MacOSX El Capitan 10.11.3,gcc 版本 4.9.2 20141029(预发行版)。 似乎没有其他人在 stackoverflow 和谷歌上报告过这个问题(进行了快速搜索)。
(更新)解决方案:
我解决了编辑 setup.py
安装文件中的 os_clang_fix()
,注释:
# for flag in ["CFLAGS", "CPPFLAGS"]:
# if flag not in os.environ:
# os.environ[flag] = "-Qunused-arguments"
# elif "-Qunused-arguments" not in os.environ[flag]:
# os.environ[flag] += " -Qunused-arguments"
最佳答案
这是 clang
特定的选项,据我所知,它在 gcc
中不可用。
来自 clang
联机帮助页:
-Qunused-arguments Don't emit warning for unused driver arguments.
你 [至少] 有两个选择来解决这个问题:
- 删除项目构建文件周围出现的任何
Qunused-arguments
(我真的不推荐这个)。 - 安装
clang
(只需在终端上运行clang
并按照安装说明进行操作)。
还有[个人意见],如果你因为任何特殊原因不需要gcc
,卸载它,并在你的OSX上保留clang
,因为它看起来是Apple 的愿望:)。
关于macos - MacOSX El Capitan上安装Biopython,gcc报错-Qunused-arguments,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38839201/