5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cx_Freezeでファイルサイズを抑える

Posted at

cx_FreezeのSetup.pyの注意点

  • Option
    • ポイント
      • packagesは使わない。includesを利用する。
      • excludesでいらないものを指定する。
  • コンソールアプリの場合
    • excludes=["PyQt4","PyQt5"]を指定するだけで、30Mは減る。
setup.py
import sys
from cx_Freeze import setup, Executable

copyDependentFiles = True
silent = True
base = None

packages = []
includes = ['re', 'webbrowser', 'urllib.parse']
excludes = ["PyQt4","PyQt5"]

# exe にしたい python ファイル
my_exe = Executable(script='hoge.py', base=base)

setup(
    name='Hoge',
    version='0.1',
    options={'build_exe': {'includes': includes, 'excludes': excludes, 'packages': packages}},
    executables=[my_exe]
)

5
4
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
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?