构建python包时找不到MacOS构建问题lstdc++

Bry*_*ant 0 python macos homebrew clang

在尝试在 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
Run Code Online (Sandbox Code Playgroud)

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

我在构建中看到的另一件事是:

  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.7
Run Code Online (Sandbox Code Playgroud)

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

Bry*_*ant 9

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

export MACOSX_DEPLOYMENT_TARGET=10.9

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

move to libc++ with a minimum deployment target of OS X 10.9
Run Code Online (Sandbox Code Playgroud)

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