电脑更新到macOS High Sierra 10.13.2后,finder等软件更换了访达等类似的英文,感觉不习惯,于是更新的同时切换了系统语言,谁知再次进入的时候使用cocos 命令报错了!然后百度解决,特此记录下.
报错信息
Traceback (most recent call last):
File "/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py", line 22, in <module>
import cocos_project
File "/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos_project.py", line 4, in <module>
import cocos
File "/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py", line 874, in <module>
language, encoding = locale.getlocale()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 562, in getlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
解决如下
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Add these to your .bash_profile
感谢:
https://www.douban.com/note/562327141/
网友评论