1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pyファイルexe化を1クリックで出来るようにする(環境が汚れないver)

Posted at

https://qiita.com/mtoneru/items/8827791a0e52ec8e6813
の続編です。
↑の方法ですと、ローカルのPython環境が汚れてしまうので、virtualenvを使用します。

まず、virtualenvは必要なので準備します。

pip install virtualenv

そして、exe化したい.pyファイルがあるディレクトリで、こちらのバッチファイルを実行するだけ。

make-exe-file.bat
cd /d %~dp0
virtualenv venv
call venv\Scripts\activate
pip install -r requirements.txt
pip install pyinstaller
for %%f in (*.py) do (
    pyinstaller --clean --onefile ^
		"%%f"
)
rd /s /q build

以上です。

1
3
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?