While updating to Ubuntu 16.04 (Xenial Xerus) my .vimrc stopped working with the following error message:
vim.error: Vim(python):E319: Sorry, the command is not available
in this version: python << endpython
After a bit of wrestling I found out that you have to replace
python << endpython
python3 << endpython
The big tell was that $ vim --version yielded, among other things, -python and +python3.