Python venv, Error " Ansible could not initialize the preferred locale "

1,362 views
Skip to first unread message

Por

unread,
Dec 22, 2022, 6:03:18 PM12/22/22
to Ansible Project
Hi, is there who is like me?

I've tried
``` shell
python3 -m venv venv 

# and activate it
# then

pip install ansible
# pip in virtualenv not seems to support "--user" option

# run ansible
ansible
```

``` shell
# error
"Ansible could not initialize the preferred locale: unsupported locale setting"
```


Anyone encounted the same?

Nico Kadel-Garcia

unread,
Dec 22, 2022, 10:54:16 PM12/22/22
to ansible...@googlegroups.com
Activating venv environments is a bit of a ****shoot, if you're been
getting clever or cute with your PATH. I don't recommend using it.

Instead, urge using this:

pip3 install ansible-core --user

Note the use of the "--user" option, which puts things fairly
consistently in $HOME/.local and as part of your default PATH. No
additional "activate" step needed.

Also, don't install ansible. Only install ansible-core, and install
modules from 'ansible collections' only if and as needed. Your setup
will be *much, much, much* smaller and more stable, because the
updates of individual and non-backwards compatible modules from the
ansible collection is an unpredictable hazard if you install the
"ansible" suite of more than 100 distinct modules written by many
quite independent companies nad developers.

Nico Kadel-Garcia
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2bc5531b-e2a4-40b0-8d30-32a650b6b0ben%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages