2010-11-29 62 views
1

我試圖建立使用scons的一個python腳本的可執行文件,它與下面的跟蹤失敗:問題在Windows scons的

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是點一切都崩潰了。誰能幫我這個?

+1

您可以添加包含`VCs`你`%路徑%`目錄:沿線的東西? – 2010-11-29 14:45:22

+0

Ross,沒有安裝VC。 – fixxxer 2010-11-30 14:34:59

回答

3

您試圖從.py文件構建.exe文件嗎?在這種情況下,你不需要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/