error while running makemessages command

error while running makemessages command

Problem

when trying to translate our project using this command:

python3 managy.py makemessages --all

this error appears.

xgettext: ./venv/lib/python3.9/site-packages/charset_normalizer/__init__.py:1: Unknown encoding "utf_8". Proceeding with ASCII instead.
xgettext: Non-ASCII string at ./venv/lib/python3.9/site-packages/charset_normalizer/__init__.py:12.
          Please specify the source encoding through --from-code or through a comment
          as specified in https://www.python.org/peps/pep-0263.html.

Reason

This is because virtual environment directory inside django project.

Solution

if virtual environment directory is “venv” run this command and change “venv” whatever your virtual environment directory name:

python3 manage.py makemessages --all -i venv
AHMED ELKHAYYAT
https://elkhayyat.me

I am a very keen individual that enjoys developing Python Programming Language. I have always loved computers and technology, ever since childhood. A team player who loves to work with other people on innovative projects and to take on challenges as an opportunity to grow as an individual in both a professional and personal capacity.

3 Comments

Daniel

Worked, thank you 🙂

    AHMED ELKHAYYAT

    Happy to hear that.
    Best Wishes ^_^

ehab Samy

It works after a lot of research
Thank You
^__^

Leave a Reply

Select your currency
USD United States (US) dollar