gpt4 book ai didi

python - MacOS 构建问题 lstdc++ not found while building python package

转载 作者:行者123 更新时间:2023-12-05 08:22:52 28 4
gpt4 key购买 nike

尝试在 MacOS 上安装 python 依赖项时遇到构建错误。

    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

我安装了 xcode 和 xcode 命令行工具,我使用 Homebrew 软件,所以我通过 Homebrew 软件安装了 gcc 9.1。

我在构建中看到的另一个令人担忧的事情是:

  ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.7

我担心的是我不确定 macosx-10.7 指的是什么?我正在运行 mojave (10.14) 并且 xcode 是版本 10.2.1,那么 10.7 指的是什么?

最佳答案

令人惊讶的是,这似乎可以解决问题(对于 bash):

export MACOSX_DEPLOYMENT_TARGET=10.9

我仍然不确定 10.7 和 10.9 是什么,但是错误日志中的这一行:

move to libc++ with a minimum deployment target of OS X 10.9

让我发现导出部署目标有效地完成了它所要求的。

关于python - MacOS 构建问题 lstdc++ not found while building python package,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56083725/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com