macos - MacOSX El Capitan上安装Biopython,gcc报错-Qunused-arguments

标签 macos biopython

我正在尝试安装 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/

相关文章:

python - 如何从具有列表值的字典中检索给定键序列的所有可能组合

macos - MonoMac Create Mac Installer 导致 Merging Mono Failed。致命的未处理异常

objective-c - 如何在 macOS 中获取用户特殊文件夹的路径?

python - 如何使用 Biopython 查找蛋白质的核苷酸序列?

python - 查找每列中的字母数

python - 使用 BioPython 根据限制序列过滤 FASTA 文件

macos - 临时 OSX SSL 问题 NET::ERR_CERT_AUTHORITY_INVALID

c++ - MySQL C++ 连接器安装

javascript - ctx.lines() 在 Mac 上最多需要 8.7 秒,但在任何其他浏览器中不到 1 毫秒

python - 为什么我得到 BioPython HTTPError : HTTP Error 400: Bad Request when I use Esearch and Efetch