Fwiw I finally gave up trying to upgrade Python in the erpnext.com virtual machine download. Python 2 is too much a part of Ubuntu 16.04 LTS. Instead I created a new vm using Ubuntu 20.04 LTS (based on Easy install setup guide for erpnext installation on Ubuntu 20.04 LTS. With some modification of course) and imported a backup from the original server.