Python Kivyで作製したプログラムをPyInstallerでexeファイル化できない
解決済
回答 1
投稿
- 評価
- クリップ 0
- VIEW 1,780
発生している問題
Python Kivyで作製したプログラムを、PyInstallerを用いてexeファイル化しようとしています。
以下のサイトをそのまま試しましたが、次のようなエラーが出てしまい、exeファイルが作れずにいます。
https://www.closetoyou.jp/kivy/introduction-to-kivy16/
原因をご存知の方はご回答宜しくお願いいたします。
エラーメッセージ
shu:~/GoogleDrive/gui $ PyInstaller --name expense --onefile --noconsole main.py
[省略]
45341 ERROR: Can not find path @executable_path/webp (needed by /Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/kivy/core/clipboard/../../.dylibs/SDL2_image)
46036 INFO: Looking for eggs
46037 INFO: Python library not in binary dependencies. Doing additional searching...
Traceback (most recent call last):
46043 WARNING: stderr: Traceback (most recent call last):
File "/Users/shu/.pyenv/versions/TensorFlow/bin/PyInstaller", line 11, in <module>
46046 WARNING: stderr: File "/Users/shu/.pyenv/versions/TensorFlow/bin/PyInstaller", line 11, in <module>
sys.exit(run())
46049 WARNING: stderr: sys.exit(run())
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
46049 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
46053 WARNING: stderr: run_build(pyi_config, spec_file, **vars(args))
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
46054 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
46054 WARNING: stderr: PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main
46055 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
46059 WARNING: stderr: build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build
46060 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build
exec(text, spec_namespace)
46061 WARNING: stderr: exec(text, spec_namespace)
File "<string>", line 17, in <module>
46061 WARNING: stderr: File "<string>", line 17, in <module>
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 241, in __init__
46062 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 241, in __init__
self.__postinit__()
46063 WARNING: stderr: self.__postinit__()
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
46064 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
self.assemble()
46067 WARNING: stderr: self.assemble()
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 573, in assemble
46067 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 573, in assemble
self._check_python_library(self.binaries)
46068 WARNING: stderr: self._check_python_library(self.binaries)
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 676, in _check_python_library
46068 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 676, in _check_python_library
raise IOError(msg)
46070 WARNING: stderr: raise IOError(msg)
OSError: Python library not found: libpython3.6m.dylib, libpython3.6.dylib, Python, .Python
46070 WARNING: stderr: OSError: Python library not found: libpython3.6m.dylib, libpython3.6.dylib, Python, .Python
This would mean your Python installation doesn't come with proper library files.
46070 WARNING: stderr: This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.
46071 WARNING: stderr: This usually happens by missing development package, or unsuitable build parameters of Python installation.
46071 WARNING: stderr:
* On Debian/Ubuntu, you would need to install Python development packages
46071 WARNING: stderr: * On Debian/Ubuntu, you would need to install Python development packages
* apt-get install python3-dev
46071 WARNING: stderr: * apt-get install python3-dev
* apt-get install python-dev
46072 WARNING: stderr: * apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
46072 WARNING: stderr: * If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
46073 WARNING: stderr:
shu:~/GoogleDrive/gui $ PyInstaller expense.spec
[省略]
Traceback (most recent call last):
454 WARNING: stderr: Traceback (most recent call last):
File "/Users/shu/.pyenv/versions/TensorFlow/bin/PyInstaller", line 11, in <module>
454 WARNING: stderr: File "/Users/shu/.pyenv/versions/TensorFlow/bin/PyInstaller", line 11, in <module>
sys.exit(run())
455 WARNING: stderr: sys.exit(run())
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
455 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
456 WARNING: stderr: run_build(pyi_config, spec_file, **vars(args))
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
456 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
457 WARNING: stderr: PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main
457 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
458 WARNING: stderr: build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build
458 WARNING: stderr: File "/Users/shu/.pyenv/versions/3.6.1/envs/tensorflow/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build
exec(text, spec_namespace)
459 WARNING: stderr: exec(text, spec_namespace)
File "<string>", line 2, in <module>
459 WARNING: stderr: File "<string>", line 2, in <module>
ImportError: cannot import name 'sdl2'
459 WARNING: stderr: ImportError: cannot import name 'sdl2'
環境
MacBook Pro 2018 (macOS High Sierra 10.13.6)
pyenv 1.2.7
Python 3.6.1
Cython 0.28.5
Kivy 1.10.1
PyInstaller 3.4
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
こちらが参考になるかと思いますので、一読されてみるとよいかと思います。
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.23%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる