after upgrade homebrew ocrmypdf Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo

Since I upgraded homebrew (on macOS Catalina 15.5), ocrmypdf issues a weird error.

I issued ocrmypdf

% ocrmypdf                                              Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo(CODESET) failed Python runtime state: preinitialized 

Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo

What is nl_langinfo ?

I have these environment variables set:

LANG=en_us LC_COLLATE=en_us LC_ALL=en_US LC_CTYPE=UTF-8 

But setting these variables does not help. Settinog export PYTHONHOME=/Users/klaas/homebrew/lib/python3.7 does not help either. Does somebody know the issue ?

Add Comment
1 Answer(s)

Finally I found it.

After reading https://bugs.python.org/issue34544

I unset LC_ALL (which was en-US) and Python3.8 (and ocrmypdf) worked !

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.