[Python] Django "compilemessages" error: Can't find msgfmt (GNU gettext) on Ubuntu VPS

Discussão em 'Python' iniciado por Stack, Fevereiro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to compile translation messages in my Django project by running the following command:

    python manage.py compilemessages


    However, I get this error:

    CommandError: Can't find msgfmt. Make sure you have GNU gettext tools 0.15 or newer installed.


    So then I tried installing gettext.

    sudo apt update && sudo apt install gettext -y


    After installation, I still get the same error when running python manage.py compilemessages.

    Checked if msgfmt is installed by msgfmt --version but it says: command not found

    OS is Ubuntu and Django version is 4.2.5.

    How can I resolve this issue and make Django recognize msgfmt? Any help would be appreciated!

    Continue reading...

Compartilhe esta Página