For the complete documentation index, see llms.txt. This page is also available as Markdown.

Why am I seeing "An error was detected with your environment's locale configuration"?

This error can occur on POSIX (Mac or Linux) systems when the configured locale is not actually available. This is known to happen by default on certain AWS Lambda runtimes.

How can I fix this quickly?

Just set the LC_ALL environment variable to "C". You can do this at the command line before running your program, from within your program, or if running on AWS Lambda, from the configuration panel.

export LC_ALL=C
process.env.LC_ALL = 'C';
import os

# ...

os.environ['LC_ALL'] = 'C'
import ("os")

// ...

os.Setenv("LC_ALL", "C")
System.setProperty("LC_ALL", "C");
#include <stdlib.h>

// ...
// POSIX only
setenv("LC_ALL", "C", 1 /*overwite existing value*/);
using System;

// ... 

Environment.SetEnvironmentVariable("LC_ALL", "C");

If you are setting this from within your program, make sure you do so before you make any calls to the Apryse SDK.

Why does this happen?

This error occurs when one of the environment variables used to request a locale is set to a locale that is not present on the system. These variables are as follows:

  • LC_ALL

  • LC_COLLATE

  • LC_CTYPE

  • LC_MESSAGES

  • LC_MONETARY

  • LC_NUMERIC

  • LC_TIME

  • LANG

LC_ALL has the highest priority, so if it is set, it is used. LANG is used as a fallback, only if the other values are not set. You can search for the values of these, if set, using the following command:

You can compare the values specified for each variable to the list of available locales:

If one of the required locales is not available, you should either set the environment variable to an available locale (as shown above), or if required, generate the locale (out of scope for this FAQ).

Last updated

Was this helpful?