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

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Select your currency
USD United States (US) dollar