python2 has been officially abandoned, resulting in the new hairstyle ubuntu 20.04 without python2 by default.
When you try to install, it will report an error
sudo apt-get install -y python2
Unable to locate package python2
In addition, installing pip will not work
sudo apt-get install -y python-pip
Unable to locate package python-pip
The key point, introduce the source of the universe
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get update
sudo add-apt-repository universe
sudo apt install -y python2
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py
sudo pip install ansible==2.7.9
https://websiteforstudents.com/how-to-install-python-pip-on-ubuntu-20-04-18-04/
https://www.wxhmf.com/posts/install-python2-in-ubuntu-20.04/
Recommended Posts