美文网首页游戏开发
切换英文后cocos命令行报错(ValueError: unkn

切换英文后cocos命令行报错(ValueError: unkn

作者: love至於终老 | 来源:发表于2017-12-08 10:01 被阅读55次

    电脑更新到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/

    相关文章

      网友评论

        本文标题:切换英文后cocos命令行报错(ValueError: unkn

        本文链接:https://www.haomeiwen.com/subject/khosixtx.html