
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