python setup.py bdist_msi
How can change the directory where cx_Freeze creates the "build" and "dist" folders? When I run this command it creates them inside the python directory where I put the setup.py and myapp.py files, but I want to create them somewhere else.
There's an option for that; when you execute your distutils setup script, e.g. python setup.py build
, you can specify the directory as python setup.py build -b ..\somewhere\else\
.
Alternatively, you can set it in the code in the option dict. e.g. change
options = {
'includes': ['numpy.core._methods'],
'excludes': ['tkinter']
}
setup(name="Application", options=options, executables=[Executable("run.py", base=None)]
in your setup script to
options = {
'includes': ['numpy.core._methods'],
'excludes': ['tkinter'],
'build_exe': '..\\somewhere\\else\\'
}
setup(name="Application", options=options, executables=[Executable("run.py", base=None)]
Note that I've had some slightly different behavior with the two solutions; the first will put all of the files into a folder inside somewhere\else
, whereas the second will simply put all of the files into somewhere\else
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With