Python仮想環境上でサンプルプログラムをexe化してみます。
まず、pipをインストールします。
(sample) D:\Python3\sample>python -m ensurepip --default-pip
Looking in links: c:\Users\tomok\AppData\Local\Temp\tmphubv8k11
Requirement already satisfied: setuptools in d:\python3\sample\lib\site-packages (41.2.0)
Collecting pip
Installing collected packages: pip
Successfully installed pip-19.2.3
(sample) D:\Python3\sample>python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-20.0.2
(sample) D:\Python3\sample>
次に、pyinstaller をインストールします。
D:\Python3\sample>pip install pyinstaller
適当なソースコードを用意して保存します。
#
print('Hello Windows Python')
exe化して実行してみます。
(sample) D:\Python3\sample>pyinstaller hello.py --onefile (sample) D:\Python3\sample>dist\hello.exe Hello Windows Python (sample) D:\Python3\sample>
ということで、サンプルプログラムは無事に(?)exe化できました。
