There is a PPA available to get you the latest python:
IF you are in recovery mode
If you are in recovery mode you will need to do some things to make sure you can write to your drives, and any partitions are mounted. Per this question:
You can install software in the recovery mode, but there are a couple
of things to keep in mind:
Only /
is mounted, so if you have a separate /var, /usr, /home, you need to mount then yourself
Filesystems are mounted read-only, so you need to remount them using
sudo mount -o remount,rw /
Drivers for your network card or wireless interface may not be loaded
Be sure to run:
sudo mount -o remount,rw /
Before proceeding.
Make sure your system is up to date
sudo apt-get update
sudo apt-get upgrade --fix-missing
sudo apt-get dist-upgrade
Add the PPA
MANUALLY, by adding the following lines to /etc/apt/sources.list
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu trusty main
deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu trusty main
OR AUTOMATICALLY, if the following software is available, add it automatically:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
Now reload your repos and upgrade:
sudo apt-get update
sudo apt-get upgrade --fix-missing
Reinstall Python
sudo apt-get remove --purge python
sudo ap-get autoremove autoclean
sudo apt-get install python
Install Updated Python(s)
sudo apt-get install python2.7
This will get you the latest python and should solve your problem!
You might also want to install python 3 and/or the dev packages:
sudo apt-get install python3
sudo apt-get install python-dev python2.7-dev python3-dev
sudo apt update && sudo apt upgrade --fix-missing
solve it? – Joshua Besneatte Aug 19 '18 at 19:02