asdf-community / asdf-community/asdf-python

[macOS] install framework Python to custom Applications directory

オープン
#86 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Shell
スター
729
フォーク
65
PR マージ指標
30日以内にマージされた PR はありません

説明

I want to build a framework Python, but I do not want to write to `/Applications`.

I tried setting `PYTHON_CONFIGURE_OPTS="--enable-framework=/Users/dilum/Desktop"`, but it still tries to write to `/Applications`

Is there a way to build a framework Python without writing to `/Applications`?

For example, here is the log:
```bash
$ export PYTHON_CONFIGURE_OPTS="--enable-framework=/Users/dilum/Desktop"
$ asdf install python 3.9.1
python-build 3.9.1 /Users/dilum/.asdf/installs/python/3.9.1
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.1.tar.xz...
-> https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz
Installing Python-3.9.1...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 11.1 using python-build 1.2.21-6-g2bf6111f)

Inspect or clean up the working tree at /var/folders/jy/7hh5zyw95cg2lh66lfpthqq80000gn/T/python-build.20210108043524.65081
Results logged to /var/folders/jy/7hh5zyw95cg2lh66lfpthqq80000gn/T/python-build.20210108043524.65081.log

Last 10 log lines:
cp ./../Icons/PythonLauncher.icns "Python Launcher.app/Contents/Resources"
cp ./../Icons/PythonSource.icns "Python Launcher.app/Contents/Resources"
cp ./../Icons/PythonCompiled.icns "Python Launcher.app/Contents/Resources"
cp ./factorySettings.plist "Python Launcher.app/Contents/Resources"
cp -R ./English.lproj "Python Launcher.app/Contents/Resources"
test -d "/Applications/Python 3.9" || mkdir -p "/Applications/Python 3.9"
mkdir: /Applications/Python 3.9: Permission denied
make[2]: *** [install] Error 1
make[1]: *** [install_PythonLauncher] Error 2
make: *** [frameworkinstallapps] Error 2
```

In contrast, a regular (non-framework) build works just fine. In a brand-new Bash session:
```bash
$ asdf install python 3.9.1
python-build 3.9.1 /Users/dilum/.asdf/installs/python/3.9.1
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.1.tar.xz...
-> https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz
Installing Python-3.9.1...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.1 to /Users/dilum/.asdf/installs/python/3.9.1

$ asdf shell python 3.9.1
$ python --version
Python 3.9.1
$ asdf list
python
3.9.1
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず `PYTHON_CONFIGURE_OPTS="--enable-framework=/Users/dilum/Desktop"` を指定して `asdf install python 3.9.1` を再現し、次に python-build のログを調べて通常のビルドと比較します。Framework のインストールが `/Applications/Python 3.9` の作成を試みなくなり、要求されたカスタムディレクトリ内で完了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
macos, python, shell
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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