if 'bdist_msi' in sys.argv:
sys.argv += ['--add-to-path', 'True']
您的代码应该如下所示:
if 'bdist_msi' in sys.argv:
sys.argv += ['--add-to-path', 'True']
setup( name = "cabbage",
version = "0.1",
description = "just a vegetable",
add_to_path = True, # <-- Just here
options = {"build_exe": build_exe_options},
executables = [Executable("spam.py", base=base)])