我试图使用scon为python脚本构建一个可执行文件,但下面的跟踪失败了:
C:\WORKAREA\study>C:\Python26\Scripts\scons
scons: Reading SConscript files ...
scons: warning: No installed VCs
File "C:\WORKAREA\study\SConstruct", line 1, in <module>
scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "C:\WORKAREA\study\SConstruct", line 1, in <module>
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /OUT:fibo.exe fibo.py
'link' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [fibo.exe] Error 1
scons: building terminated because of errors.看来,链接/nologo /OUT是每件事都崩溃的地方。有人能帮我吗?
发布于 2010-11-30 00:24:15
您正在尝试从一个.exe文件构建一个.py文件,对吗?在这种情况下,您不需要VC++编译器,您将需要像py2exe这样的工具。如果您想使用SCons作为构建系统,则需要为py2exe.exe创建一个SCons构建器。大致如下的东西:
env = Environment()
def py2exe_action(target, source, env):
# execute py2exe <source> <output> here
return 0
env['BUILDERS']['Py2Exe'] = env.Builder(action = py2exe_action)
env.Default(env.Py2Exe(target = 'out_exe_file.exe', source = 'in_python_file.py'))http://www.py2exe.org/
https://stackoverflow.com/questions/4304559
复制相似问题