LoginSignup
51
68

More than 5 years have passed since last update.

PyInstallerがPython3.6をサポートしてくれた

Posted at

PyInstallerのPython3.6対応

長らくPyInstallerがPython3.6に対応していなかったのですが,先日たまたま確認したら3.6へのサポートが追加されていました.
https://github.com/pyinstaller/pyinstaller/releases

PyInstallerとは

Pythonプログラムを実行可能ファイルにパッケージングしてくれるツールです.いくつか同じようなツールがありますが,自分はPyInstallerがお手軽で愛用しています.なんですが,しばらくの間Python3.6に対応しておらず困っていたところでした.
簡単なツールをPythonで作ったときに,まわりに配布するときに便利です.

PyInstallerの使い方

せっかくなので簡単な使い方も載せておきます.最近確認した環境は以下です.

  • Windows 10 Pro
  • Python 3.6.3
  • PyInstaller 3.3

インストール

pipでインストール可能です.

> pip install pyinstaller

使い方

基本的には以下のように使います.

> pyinstaller spam.py

あと知っておくと便利なのは,パッケージングするときに1ファイルにまとめたいときは--onefile,GUIアプリなどでコンソール画面を出さないようにしたい場合は--noconsoleオプションをつけるといいです.
また以前はPyQt5を使っている場合にPyQtのパスを指定する必要があったのですが,最近確認したときは指定なしでうまく動きました.

> pyinstaller spam.py --onefile --noconsole --paths ".\env\Lib\site-packages\PyQt5\Qt\bin"    # --pathsはなくても動きました
51
68
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
51
68