概要
pyinstallerのv3.3がリリースされました。ついに python 3.6 のサポートが追加!!
待ちわびてた人も多いのじゃないでしょうか。
使い方などは今までと同じです。
$ python -V
Python 3.6.1 :: Anaconda custom (x86_64)
# pyinstaller 入れていない場合は入れておく
$ pip install pyinstaller
# 既に pyinstaller 入っている場合は upgrade
$ pip install --upgrade pyinstaller
# サンプル用スクリプト作ってみる
$ cat helloworld.py
def __main():
print('hello world')
if __name__ == '__main__':
__main()
# pyinstaller使って standalone モジュール作成
$ pyinstaller --onefile helloworld.py
# distの下に出来上がり
$ cd dist
$ file helloworld
helloworld: Mach-O 64-bit executable x86_64
$ ./helloworld
helloworld
補足
PyQTなどのUIを持つアプリをpyinstallerで固める場合は以下の情報が参考になります。
過去の記事については、以下のページからご参照下さい。
- いろいろ備忘録日記まとめ
サンプルコードは、以下の場所で公開しています。
- いろいろ備忘録日記サンプルソース置き場