nixified-ai / flake

A Nix flake for many AI projects
GNU Affero General Public License v3.0
624 stars 69 forks source link

Error: unsupported locale setting #43

Open pbsds opened 1 year ago

pbsds commented 1 year ago

During initial setup with nix run .#invokeai-nvidia on a non-nixos machine i got Error: unsupported locale setting thrown from nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/lib/python3.10/locale.py:620.

The fix is as easy as export LC_ALL=C, but it is not something i want to add to my bash profile. I've run into something like this before, and my fix at the time was to include more locales in the runtime closure.

Additional context

$ env | grep -e ^LC_ -e ^LOCAL -e ^LANG | sort
LANG=en_US.UTF-8
LC_ADDRESS=nb_NO.UTF-8
LC_IDENTIFICATION=nb_NO.UTF-8
LC_MEASUREMENT=nb_NO.UTF-8
LC_MONETARY=nb_NO.UTF-8
LC_NAME=nb_NO.UTF-8
LC_NUMERIC=nb_NO.UTF-8
LC_PAPER=nb_NO.UTF-8
LC_TELEPHONE=nb_NO.UTF-8
LC_TIME=nb_NO.UTF-8

The setup worked fine on my nixos machine, which also uses a norwegian locale.

MatthewCroughan commented 1 year ago

Yeah we need to figure out what we're going to do regarding this. I'm thinking we'll simply have to set LC_ALL=C if you're running outside of NixOS, which limits us to English outside of NixOS.

1800alex commented 9 months ago

I was able to get by this issue by using LC_ALL="C" nix run --extra-experimental-features nix-command --extra-experimental-features flakes github:nixified-ai/flake#invokeai-amd -- --web in case anyone using nix-shell has this same issue

pbsds commented 9 months ago

To get luatex working in the past i added this line to environment variable to mkShell:

LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";

Possibly something to look into