Technology Reviews

Python alternatives

Ok, so, never, ever, ever, change the python versions installed by the OS. Don’t do it. There are OS scripts dependent on that exact version and python libraries/modules in the Canonical repos match that expected version.

To have other versions of python on your system, use a python versioning tool. I think pyenv is one. This installs whatever version of python you like to somewhere under your HOME. You can install 50 different python versions, each with libraries and modules just for that version.

Hopefully, someone else, who actually uses python will respond with more details.

I’m a Perl and Ruby guy. They both have similar tools to allow 50 versions of each interpreter to be installed and updated and maintained. For perl, I use perlbrew. For ruby, I use rvm. With these tools, when I need to deploy an application with a specific version of the interpreter and modules, there’s a command to package up everything so it can be moved to pre-prod, tested, then moved to production.

Clear as mud?

1 warning. If you are like me, you’ll forget which version of the language is active and may accidentally run some OS tools with the wrong python found, which can screw the system up. Be careful. Once I did an LTS-to-LTS upgrade with the wrong perl being used. It was ugly and wouldn’t boot after finishing. I had to restore from prior backups to try again. Of course, I didn’t realize the version of perl was the problem until later. Now I have to specifically set the version of perl when I’m using it and use different colors in my terminals so I don’t forget which have a custom perl and which are using the default, system-perl. That might be helpful for your setup, just with python.