arm mac jpype安装错误(使用似乎不存在的SDK编译)

问题描述 投票:0回答:1

错误日志:

--- stderr:
Compiling with an SDK that doesn't seem to exist: /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk
Please check your Xcode installation
clang: warning: no such sysroot directory: '/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk' [-Wmissing-sysroot]
clang: warning: argument unused during compilation: '-L/opt/homebrew/lib' [-Wunused-command-line-argument]
In file included from native/common/jp_array.cpp:16:
native/common/include/jpype.h:64:10: fatal error: 'map' file not found
#include <map>
         ^~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
---
error: Installation of dependencies failed in venv at

环境:

❯ echo $SDKROOT
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
❯ xcrun --sdk macosx --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
❯ echo $CPPFLAGS
-I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/include -L/opt/homebrew/lib -I/opt/homebrew/opt/libpq/include -I/opt/homebrew/opt/mysql-client/include -I/opt/homebrew/opt/openjdk@17/include
❯ java --version
openjdk 17.0.11 2024-04-16
OpenJDK Runtime Environment Homebrew (build 17.0.11+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.11+0, mixed mode, sharing)

jpype
上安装
python3.9
出现上述错误。

我也有

java
,我想我已经安装了
macos sdk
, 但构建时似乎走错了路径。

我什至无法创建符号链接。

我该如何解决这个问题? 这是 M2 ARM MacBook Air。

python java macos jpype
1个回答
0
投票

如何解决: (在 zshrc 中)

export CPPFLAGS="-isysroot $SDKROOT $CPPFLAGS"
© www.soinside.com 2019 - 2024. All rights reserved.