I'm having some issue using the default python version of my Ubuntu Mate 18.04 (2.7.15+) with a program that requires a more modern Unicode support (as far as I understood 2.7.16 would be enough). Can the default python be safely upgraded to that version in Ubuntu Mate? Otherwise, is there a way to launch a program somehow pointing him to python3? The author of this specific software suggested me to launch it using the -R option, that is supposed to autodetect the newer version of python and reset the default, or so he says, but it don't work.
This is the error I get when I try to run a python script from that program:
Error: could not find symbol "PyUnicodeUCS2_FromWideChar"
Python could not be properly initialized. We must quit.
EDIT: the problem was solved for me with an internal setting of the software, but I would take advantage of the circumstance to understand better the matter: is Mate (or Ubuntu) compatible with a more recent version of Python 2.7 set as default? If not, it would still possible to install Python 3 in a standard path such as /usr/lib? And how does the -R (or -r?) option work? I can't find anything online about it.
In some distributions, python might run Python 3.x, and have python2 instead. Ubuntu has both python2 and python3, with python defaulting to 2.x.
While possible, I wouldn't recommend manually installing a version of Python 2.x or 3.x outside the distribution's repositories, as it can become a pain to maintain multiple versions of Python on the system, the libraries required by programs and can introduce inconsistency issues.
There is a tool called virtualenv that can be used to create isolated environments of Python.
Tip - Ubuntu 19.10 that's being released on the 17th of October ships Python 2.7.16.
Thank you very much for your answer. I didn't know of virtualenv, luckily my problem has been solved but it could be of use in the future. It also interesting that Ubuntu 19.10 is released with Python 2.7.16, although I need to stick to LTS version because I some other software that I need is optimized and maintained only for LTSs. But it is good to know that when I'll upgrade to 20.04 I will find it there.