If i try to compile messages in Django I get erros like this:
sh: msgfmt: command not found
while from bash (terminal) all these commands work
Actually PyCharm itself doesn't use either sh or bash to run these commands; it runs the manage.py Python script using the interpreter configured in Settings | Python Interpreters. The compilemessages command uses os.system() Python function to run the msgfmt command. The os.system() function runs the system() C function, which always uses /bin/sh.
Therefore, you need to configure your OS in such a way that msgfmt could be run from /bin/sh.
This problem can be solved by installing gettext
tool, in debian/ubuntu you can execute sudo apt-get install gettext
, for windows is explained in django doc.
Also see this and this for others SO and explanations.
I got the same error message but from other cause and solve it in this way.