首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >windows中的scons问题

windows中的scons问题
EN

Stack Overflow用户
提问于 2010-11-29 14:14:19
回答 1查看 3.6K关注 0票数 1

我试图使用scon为python脚本构建一个可执行文件,但下面的跟踪失败了:

代码语言:javascript
复制
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是每件事都崩溃的地方。有人能帮我吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-11-30 00:24:15

您正在尝试从一个.exe文件构建一个.py文件,对吗?在这种情况下,您不需要VC++编译器,您将需要像py2exe这样的工具。如果您想使用SCons作为构建系统,则需要为py2exe.exe创建一个SCons构建器。大致如下的东西:

代码语言:javascript
复制
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/

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4304559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档