Closed jakobjs closed 1 year ago
Side note: Default install also fails since it tries to use the PPA to install.
Ansible is now a system package and is included in Ubuntu 20.04+ so the PPA should not be used: https://packages.ubuntu.com/focal/ansible
The solution may be as simple as running python3
instead of python
.
I've hit this too. Worked fine last week but this week I get the same error as above. I am using Ubuntu 18.04 and I have only managed to get it to build by changing the install command:
ansible.pip_install_cmd = "sudo apt-get -y install python-pip"
This seems a bit wrong and I'm sure i should be doing it a better way.
If you change the install cmd to use python3 instead of python you get a problem relating to a missing python package dist_utils.
I'm told this is likely to do with the deprecation of Python 2.
I'm using this in the context of a drupalvm implementation with the latest geerlingguy/drupavm base box (2.0.10), in case that is useful to know.
Getting into the thread! The same error appears using my Vagrantfile
Most likely it's related with pip 21.0 (2021-01-23) changelog. (Drop support for Python 2 and Python 3.5)
The syntax f''
is supported by Python 3.6+
Most likely it's related with pip 21.0 (2021-01-23) changelog. (Drop support for Python 2 and Python 3.5)
We've had quite a few problems this week in the same vein - that'll teach me not to get around to swapping to 3.6 for our CI systems!
As hinted at by a few others I've amended my Vagrantfile to add something like this, which is now working again.
config.vm.provision "ansible_local" do |ansible|
....
ansible.pip_install_cmd = "sudo apt-get install -y python3-distutils && curl -s https://bootstrap.pypa.io/get-pip.py | sudo python3"
end
I found I needed to add python3-distutils
on the bento/ubuntu-18.04
boxes, but YMMV.
@samdbmg your workaround works for me. Thanks! 👍
A more elegant workaround for this issue is to use pip3
instead of pip
as Ansible Installation method that works on Ubuntu 20.04/Focal
config.vm.provision "ansible_local" do |ansible|
....
ansible.install_mode = "pip3"
end
Vagrant version
Host operating system
Guest operating system
Vagrantfile
Debug output
Expected behavior
ansible should run
Actual behavior
ansible does not run
Steps to reproduce
References
None