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

オープン
#186 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

clj-python/libpython-clj のほかの issue

clj-python/libpython-clj の issue をすべて見る

似ている issue

Clojure の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。