8

https://www.youtube.com/watch?v=AlJ8cGbk8ps i followed this video and when i do this command django-admin makemessages -l ar it gives me this error CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed. and i have installed pip install python-gettext any aswers? Thanks in advance

Yehia Yasser
  • 75
  • 1
  • 6

1 Answers1

12

and i have installed pip install python-gettext

The problem is not the Python binding of gettext, it is the gettext library itself. This is not a Python library, but a system library.

You can install this on a debian-like system (Debian, Ubuntu, Raspbian, and Knoppix):

sudo apt-get install gettext

For other operating systems, you can probably build it from the source files, or look for a repository that makes binaries.

Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
  • 2
    it gives me this sudo: The term 'sudo' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. – Yehia Yasser Dec 18 '20 at 17:56
  • 3
    @YehiaYasser: as specified this is for Debian systems: `sudo` is a way to get root access to the system. For Windows you will likely have to build `gettext` manually, or look for someone who made an installer from the source code. – Willem Van Onsem Dec 18 '20 at 17:57
  • 1
    do you know how to build it ? – Yehia Yasser Dec 18 '20 at 17:57
  • 4
    Apparently someone did that and made installation packages: https://mlocati.github.io/articles/gettext-iconv-windows.html – Willem Van Onsem Dec 18 '20 at 17:59
  • 1
    it does not work man i extracted the file to the C:\Program Files\gettext-utils – Yehia Yasser Dec 18 '20 at 18:18
  • 1
    @YehiaYasser: but you do not need to extract it, you need to *build* it too. You should include `msguniq` in the `PATH` variable. I don't know if the installer automates that somehow, I'm happy I didn't had to work on Windows machines for the last 12 years. – Willem Van Onsem Dec 18 '20 at 18:21
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/226146/discussion-between-yehia-yasser-and-willem-van-onsem). – Yehia Yasser Dec 18 '20 at 18:22
  • 1
    @YehiaYasser: you likely should add the `bin` directory to the `PATH` environment variable, such that the command `msguniq` will invoke the program in the `bin` directory. – Willem Van Onsem Dec 18 '20 at 18:24
  • 1
    done i have added this path C:\Program Files\gettext-utils\bin to the environment variable – Yehia Yasser Dec 18 '20 at 18:27
  • @YehiaYasser: so if you type `msguniq` in a terminal, this invokes the program? – Willem Van Onsem Dec 18 '20 at 18:30
  • in witch terminal – Yehia Yasser Dec 18 '20 at 18:31
  • @YehiaYasser: in a shell... Just like you invoke for example `python`..... – Willem Van Onsem Dec 18 '20 at 18:32
  • it give me this msguniq: The term 'msguniq' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. – Yehia Yasser Dec 18 '20 at 18:37
  • @YehiaYasser: then it is not in the PATH, or it at least did not "ripple" through the system: https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/ – Willem Van Onsem Dec 18 '20 at 18:38
  • https://www.facebook.com/yehiayasserahmed/this is my profile can we talk on messenger? – Yehia Yasser Dec 18 '20 at 18:41
  • i dont understand anything please help me – Yehia Yasser Dec 18 '20 at 18:44
  • please give me an answer – Yehia Yasser Dec 18 '20 at 19:00