failure on macos M1 when JVM and python architecture do not match

未关闭
#186 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
clojure, python

调研方向

从 libpython-clj2/python.clj:87 和 initialize! 函数开始,然后查找有关设置和架构要求的相关文档。确认如何获取 JVM 和 Python 的架构,记录匹配要求,并确保初始化在两者不一致时报告清晰的错误。

由索引模型根据 Issue 内容生成。

描述

I tried out libpython-clj and was facing the following error message:

"Execution error at libpython-clj2.python/initialize! (python.clj:87).
Failed to find a valid python library!"

The cause of this error was that I was using JVM for x86_64 via Rosetta and python was referencing to a native arm64.
After using a arm64 JVM it worked.
It took me quite some time to figure this out.

I think it would be helpful to mention in the docs that the architecture of python and jvm must match.
Further we could check this requirement during the initialize! function and return a proper error message.
This would improve user experience.
In the JVM we can check the architecture with:

(System/getProperty "os.arch")
This gives aarch64 or x86_64.
In python we can check the architecture with:

import platform
platform.machine()

on M1 this returns 'arm64'.

Hendrik

主要语言
Clojure
星标
1.2k
派生
74
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

clj-python/libpython-clj 的其他 Issue

查看 clj-python/libpython-clj 的全部 Issue

相似的 Issue

更多 Clojure Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。