cocos2d-x v3.11.1 COCOS command error

Environment:
OSX 10.10.4
Python v.2.7.6
java 1.7
NDK 10e
Project to be used with Android Studio.

I tried setting up cocos2d-x freshly with v3.11.1 and ndk is 10e
After the comment python ./setup.py has setup environment variables.
And now, cocos command is itself giving the following error.

Can someone help me fix this error?

Traceback (most recent call last):
  File "/Users/myuser/Documents/workcocos/cocos2d-x-3.11.1/tools/cocos2d-console/bin/cocos.py", line 22, in <module>
    import cocos_project
  File "/Users/myuser/Documents/workcocos/cocos2d-x-3.11.1/tools/cocos2d-console/bin/cocos_project.py", line 4, in <module>
    import cocos
  File "/Users/myuser/Documents/workcocos/cocos2d-x-3.11.1/tools/cocos2d-console/bin/cocos.py", line 936, in <module>
    language, encoding = locale.getlocale()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 530, in getlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

Solves the issue.

Hi @slackmoehrle,

If you find this thing important then this can be added to the programmer guide.
And people facing similar issue can proceed instantly instead of searching a lot. I saw that the post having this solution had so many people got stuck on this.

I feel like this has been documented so many places, but you are right, it is not in the Programmers Guide.

I will add it.

It is happens in version 3.12 also i open issue in github

This is not a bug though…

The problem with this “Problem” is more deep then what you think .
For example:
Imagine new user that come’s to use Cocos2d-x trying to create new project , and find out that the only way to do this
is using Console . he try’s the Console and it fails … maybe he will search for answer … but many wont .
You need to lower the friction for new users .

I’ll document the fix, besides it being documented here too. That makes sense.

But, if we change default to UTF-8, what about those that get an error because they don’t use UTF-8? Sort of a catch 22 either way. Perhaps we could check when they run Cocos Console for the first time and have them selected UTF-8 or not? Or maybe the engineers can set an env var for Console that sets this each time it is launched, not sure.

I suggested to try and catch the python exception and then to print the fix suggestion to the STDOUT
see the GitHub issue i opened
this is python + MAC problem as i understand