I just ran into this problem on Pop!_OS 18.04, trying to upgrade to 18.10, and it turns out that the problem lay in the symlink for /usr/bin/python and not for /usr/bin/python3. I had had /usr/bin/python3.6 configured as an alternative for python (not python3), and when I changed this, then I could run do-release-upgrade as expected.
I wish the error message pointed to python and not python3.
Before, with the problem:
$ update-alternatives --display python
python - manual mode
link best version is /usr/bin/python3.6
link currently points to /usr/bin/python2.7
link python is /usr/bin/python
/usr/bin/python2.7 - priority 1
/usr/bin/python3.6 - priority 2
I fixed it this way:
$ sudo update-alternatives --remove-all python
$ sudo ln -sf /usr/bin/python2.7 /usr/bin/python
来源 https://askubuntu.com/questions/1104052/your-python3-install-is-corrupted