Env

用scons构建代码出现问题

发布于 2016-06-06 10:35:14
我已经安装了python,scons,并且已经添加环境变量成功了,但是我在BSP/stm32f10x目录下执行scons构建代码的时候出现错误,不知道为啥?哪位大神帮忙看一下啊
D:\rt-thread\bsp\stm32f10x>scons
scons: Reading SConscript files ...
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd3 in position 9: ordinal not in range(128):
File "D:\rt-thread\bsp\stm32f10x\SConstruct", line 27:
Export('RTT_ROOT')
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Script\SConscript.py", line 602:
env = self.factory()
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Script\SConscript.py", line 582:
default_env = SCons.Defaults.DefaultEnvironment()
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Defaults.py", line 88:
_default_env = SCons.Environment.Environment(*args, **kw)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Environment.py", line 982:
apply_tools(self, tools, toolpath)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Environment.py", line 107:
env.Tool(tool)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Environment.py", line 1789:
tool(self)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\__init__.py", line 190:
self.generate(env, *args, **kw)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\default.py", line 41:
SCons.Tool.Tool(t)(env)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\__init__.py", line 190:
self.generate(env, *args, **kw)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\mslink.py", line 312:
msvc_setup_env_once(env)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\MSCommon\vc.py", line 400:
msvc_setup_env(env)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\MSCommon\vc.py", line 507:
d = msvc_find_valid_batch_script(env,version)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\MSCommon\vc.py", line 457:
d = script_env(vc_script, args=arg)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\MSCommon\vc.py", line 346:
stdout = common.get_output(script, args)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\MSCommon\common.py", line 160:
env['ENV'] = normalize_env(env['ENV'], vars, force=False)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.5.0\SCons\Tool\MSCommon\common.py", line 117:
normenv[k] = copy.deepcopy(env[k]).encode('mbcs')

D:\rt-thread\bsp\stm32f10x>

查看更多

关注者
0
被浏览
1.4k
4 个回答
pyh0603
pyh0603 2016-06-06
我之前安装了一个python 3.x,但是后来我卸载了,不知道有没有影响?
pyh0603
pyh0603 2016-06-06
哈哈,找到问题啦,聪明如我!
在Python的Lib/site-packages 文件夹下新建sitecustomize.p y 内容为

import sys
sys.setdefaultencoding('gb2312')

此时即可构建成功!

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友