2017-04-17 96 views

回答

2

有一个选项,当您执行distutils设置脚本时,例如python setup.py build,你可以指定目录为python setup.py build -b ..\somewhere\else\

或者,您可以在选项dict中的代码中进行设置。例如在你的安装脚本改变

options = { 
    'includes': ['numpy.core._methods'], 
    'excludes': ['tkinter'] 
} 
setup(name="Application", options=options, executables=[Executable("run.py", base=None)] 

options = { 
    'includes': ['numpy.core._methods'], 
    'excludes': ['tkinter'], 
    'build_exe': '..\\somewhere\\else\\' 
} 
setup(name="Application", options=options, executables=[Executable("run.py", base=None)] 

请注意,我已经受够了两种解决方案略有些不同的行为;第一个将把所有的文件放到里面somewhere\else,而第二个文件只会把所有的文件放到somewhere\else