5
10

More than 3 years have passed since last update.

Pythonをexeファイルに変換する方法

Posted at

Pythonで作成したファイルを、Pythonが入っていないPCで実行したい。
そんな悩みを解決するためのツールをシェアさせていただきます。
あくまで、自分用のメモの拡張版なのでクオリティーに関してはご愛嬌でお願いします。

1.環境構築

コマンドプロンプトの場合
コマンドプロンプト
pip install pyinstaller
Anacondaプロンプトの場合。
Anacondaプロンプト
conda install pyinstaller

2.実行

プロンプト
pyinstaller [ファイル名].py --onefile

注意点

  • 最後のオプションにある--onefileの入力を省くとdist内のファイルが複数必要になるので移動がめんどくさくなります。
  • inputなどのコマンドプロンプトで入力を求めるものなどは、できないので注意してください。
5
10
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
5
10