Pycharm IDE tries to load django script from sh instead of bash

前端 未结 2 927
礼貌的吻别
礼貌的吻别 2021-01-22 18:41

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

2条回答
  •  深忆病人
    2021-01-22 19:09

    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.

提交回复
热议问题