cocos2d-js配置好了,运行项目出错,是怎么回事?

运行 ——cmd.exe运行项目出现这个问题,有谁知道是什么问题??环境变量没有设置好吗?
C:\Users\Administrator>cd C:\Users\Administrator\Desktop\hellworld

C:\Users\Administrator\Desktop\hellworld>cocos run -p web
Running command: compile
Building mode: debug
Running command: deploy
Deploying mode: debug
Running command: run
starting application
Traceback (most recent call last):
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 548, in
run_plugin(command, argv, plugins)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 514, in ru
n_plugin
plugin.run(argv, dependencies_objects)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 162, in run
self.run_web(dependencies)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 105, in run_web
from SimpleHTTPServer import SimpleHTTPRequestHandler
File “D:\Python27\lib\SimpleHTTPServer.py”, line 27, in
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File “D:\Python27\lib\SimpleHTTPServer.py”, line 208, in SimpleHTTPRequestHand
ler
mimetypes.init() # try to read system mime.types
File “D:\Python27\lib\mimetypes.py”, line 358, in init
db.read_windows_registry()
File “D:\Python27\lib\mimetypes.py”, line 258, in read_windows_registry
for subkeyname in enum_types(hkcr):
File “D:\Python27\lib\mimetypes.py”, line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1: ordinal
not in range(128)
C:\Users\Administrator\Desktop\hellworld>cocos run -p web
Running command: compile
Building mode: debug
Running command: deploy
Deploying mode: debug
Running command: run
starting application
Traceback (most recent call last):
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 548, in
run_plugin(command, argv, plugins)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 514, in ru
n_plugin
plugin.run(argv, dependencies_objects)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 162, in run
self.run_web(dependencies)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 105, in run_web
from SimpleHTTPServer import SimpleHTTPRequestHandler
File “D:\Python27\lib\SimpleHTTPServer.py”, line 27, in
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File “D:\Python27\lib\SimpleHTTPServer.py”, line 208, in SimpleHTTPRequestHand
ler
mimetypes.init() # try to read system mime.types
File “D:\Python27\lib\mimetypes.py”, line 358, in init
db.read_windows_registry()
File “D:\Python27\lib\mimetypes.py”, line 258, in read_windows_registry
for subkeyname in enum_types(hkcr):
File “D:\Python27\lib\mimetypes.py”, line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1: ordinal
not in range(128)
C:\Users\Administrator\Desktop\hellworld>cocos run -p web
Running command: compile
Building mode: debug
Running command: deploy
Deploying mode: debug
Running command: run
starting application
Traceback (most recent call last):
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 548, in
run_plugin(command, argv, plugins)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 514, in ru
n_plugin
plugin.run(argv, dependencies_objects)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 162, in run
self.run_web(dependencies)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 105, in run_web
from SimpleHTTPServer import SimpleHTTPRequestHandler
File “D:\Python27\lib\SimpleHTTPServer.py”, line 27, in
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File “D:\Python27\lib\SimpleHTTPServer.py”, line 208, in SimpleHTTPRequestHand
ler
mimetypes.init() # try to read system mime.types
File “D:\Python27\lib\mimetypes.py”, line 358, in init
db.read_windows_registry()
File “D:\Python27\lib\mimetypes.py”, line 258, in read_windows_registry
for subkeyname in enum_types(hkcr):
File “D:\Python27\lib\mimetypes.py”, line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1: ordinal
not in range(128)
C:\Users\Administrator\Desktop\hellworld>cocos run -p web
Running command: compile
Building mode: debug
Running command: deploy
Deploying mode: debug
Running command: run
starting application
Traceback (most recent call last):
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 548, in
run_plugin(command, argv, plugins)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin/cocos.py”, line 514, in ru
n_plugin
plugin.run(argv, dependencies_objects)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 162, in run
self.run_web(dependencies)
File “D:\cocos2d-js-v3.0\tools\cocos2d-console\bin…\plugins\project_run\proj
ect_run.py”, line 105, in run_web
from SimpleHTTPServer import SimpleHTTPRequestHandler
File “D:\Python27\lib\SimpleHTTPServer.py”, line 27, in
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File “D:\Python27\lib\SimpleHTTPServer.py”, line 208, in SimpleHTTPRequestHand
ler
mimetypes.init() # try to read system mime.types
File “D:\Python27\lib\mimetypes.py”, line 358, in init
db.read_windows_registry()
File “D:\Python27\lib\mimetypes.py”, line 258, in read_windows_registry
for subkeyname in enum_types(hkcr):
File “D:\Python27\lib\mimetypes.py”, line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1: ordinal
not in range(128)
C:\Users\Administrator\Desktop\hellworld>

问题解决参考下面的链接:
http://cn.cocos2d-x.org/tutorial/show?id=1661

问题3:UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1: ordinal not in range(128)
解决方案:进入python安装目录, Lib/mimetypes.py文件中,找到以下代码
12345try: ctype = ctype.encode(default_encoding) # omit in 3.x!# except UnicodeEncodeError:except UnicodeError: pass
注释了原来的异常判断。 在 except UnicodeEncodeError 加了#号,注释,并添加了except UnicodeError。

解决答案由福州-凌建风老师提供