From 71441590b45ffc7368e8f6181b20672860f078ea Mon Sep 17 00:00:00 2001 From: tsukumi Date: Sun, 14 Jul 2024 17:45:21 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20Windows=20=E3=81=A7=20PyInstaller=20?= =?UTF-8?q?=E3=81=AE=E3=83=93=E3=83=AB=E3=83=89=E3=81=AB=E5=A4=B1=E6=95=97?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 例の dataclasses に __version__ 変数が存在しないとビルドに失敗する件で、Windows だと標準ライブラリの配置パスが異なるため dataclasses.py の書き換えに失敗していたのが原因 --- run.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run.spec b/run.spec index e127947c..5ad0a541 100644 --- a/run.spec +++ b/run.spec @@ -20,7 +20,10 @@ block_cipher = None from pathlib import Path import sys base_prefix = getattr(sys, 'base_prefix', sys.prefix) -dataclasses_path = Path(base_prefix) / 'lib' / f'python{sys.version_info.major}.{sys.version_info.minor}' / 'dataclasses.py' +if sys.platform == 'win32': + dataclasses_path = Path(base_prefix) / 'Lib' / 'dataclasses.py' +else: + dataclasses_path = Path(base_prefix) / 'lib' / f'python{sys.version_info.major}.{sys.version_info.minor}' / 'dataclasses.py' try: with dataclasses_path.open('a') as file: file.write('\n__version__ = "1.0"')