TL;DR;
-
rm -r ~/.rye
を実行する. -
curl -sSf https://rye.astral.sh/get | bash
で入れ直す.
経緯
-
あまり無いケースかもしれないが,とある理由で,M1
に入っていた内容をIntel
に入れ直した. -
python
コマンドがBad CPU type in executable
となって実行できない. -
which python
と入力すると,~/.rye
を参照していることがわかる. -
公式サイト にあるインストール方法を試す.
curl -sSf https://rye.astral.sh/get | bash
- しかし,インストール途中で
Bad CPU type in executable
と出てしまう. - インストール中のエラー出力で,
Detected outdated rye internals. Refreshing
と出ていることから,既存の(Intel
に移行する前に入れた)~/.rye
を消してから再インストールすればいんじゃね?
修正
まず,既存の rye
を消す.
rm -r ~/.rye
次に,rye
を公式サイトに従って,入れ直す.
curl -sSf https://rye.astral.sh/get | bash
対話は以下のように答えた.(ここは好みで分かれるでしょう.)
Details:
Rye Version: 0.39.0
Platform: macos (x86_64)
✔ Continue? · yes
✔ Select the preferred package installer · pip-tools (slow, higher compatibility)
? What should running `python` or `python3` do when you are not inside a Rye managed project? ›
✔ What should running `python` or `python3` do when you are not inside a Rye managed project? · Run a Python installed and managed by Rye
? Which version of Python should be used as default toolc
✔ Which version of Python should be used as default toolchain? · cpython@3.12
Installed binary to ~/.rye/shims/rye
Bootstrapping rye internals
Fetching requested internal toolchain 'cpython@3.12.5'
Downloading cpython@3.12.5
Checking checksum
Unpacking
Downloaded cpython@3.12.5
Updated self-python installation at `/.rye/self
All done!
余談
-
Intel
->M1
に移行した時は,Rosetta 2
を導入すれば解決するかもしれない. - だけど,私の場合はおそらく特殊で,
M1
->Intel
に移行したので,それに対応するやつが見つからない(探してないだけ). -
brew
も動かないし,結構面倒なことになりそう...