I am getting below error while installing the ansible version 3.0.0.
Trackback (most recent call last):
File “/usr/bin/ansible”. line 47, in
from ansible.utils.unicode import to_unicode
ImportError: cannot Import name to_unicode
I am getting below error while installing the ansible version 3.0.0.
Trackback (most recent call last):
File "/usr/bin/ansible". line 47, in <module>
from ansible.utils.unicode import to_unicode
ImportError: cannot Import name to_unicode
Stop *right* there. More contemporary versions of the basically
misnamed tarball called "ansible" have a dependency on "ansible-core",
which they will try to install first. But both the latest ansible and
ansible-core are not compatible with python 2 on the ansible server,
and actually require python 3.9 or later for the most recent releases.
Use python 3, ideally python 3.9, and install ansible-core first to
keep your dependencies clean.
pip3 install ansible-core --user --upgrade
And if you really want hundreds of Megabytes of material you're quite
unlikely to use:
pip3 install ansible --user --upgrade
If your python3 is less than python 3.9, that won't get you the latest
versions, but it should get you something usable. If your OS is so old
it lacks python3..... you've got other issues.
That should get you started. If you need to install this stuff as the
root user, to lock it down, do follow up with the name of your
operating system. There may be a more recent package already available
for you to install.