[Borgbackup] how to use on machine with python2 intact

Thomas Waldmann tw at waldmann-edv.de
Mon Sep 25 21:51:38 EDT 2017


> So..I am guessing there are “proper” ways to work with both python2 and python3 on the same machine

Usually this is not a problem if you use the right python / python tool
version as the software requires.

E.g. when software wants python 2.x, you use pip, python (or better
python2 or python2.7), etc. as commands / binary names.

For python 3.x, you use pip3, python3 (or python3.X if you want a
specific version), etc.

It's quite the usual thing nowadays that the 3.x based tools have names
ending with "3", while the old 2.x stuff has no such ending.

It might depend a bit on the OS you are using though, some linux
distributions already have boldly switched the default "python" to point
to python3.x (symlink usually).

In general, the stuff is kept separate, so there are no conflicts /
overlap except for the non-versioned names.

> running borgbackup, which as of now is the only python thing I need

If you install a borgbackup package from your OS / linux distribution,
this is usually taken care of. It will depend on python3.x etc.

> though I’m sure something else will come up eventually.

For sure, 2.x deadline is 2020.
> 1 - I need the machine’s “default” mode of operation to be python2.7 as I have many things installed which require that.  typically this means that /usr/local/bin/python is sym linked to python2 by default, but I’d like to hear more about how to properly setup a machine with both

That sounds like you are compiling python yourself.

In that case, be careful, if you run "make install", it will replace
your "python" link.

"make altinstall" is the right way, it does not overwrite "python".

> 2 - I need to know what to do to install and use python3 properly so it won’t stomp over anything related to python2

Just always use the right version of the python tools (like pip vs pip3).

When creating virtualenv, you can give --python=... to specify the
python version for the env.

If your OS does not come with py3, you can also use the borgbackup
binary, it includes python3.x and all libraries needed and won't
overwrite / influence anything else on your system.

https://github.com/borgbackup/borg/releases

Cheers, Thomas

-- 

GPG ID: 9F88FB52FAF7B393
GPG FP: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393



More information about the Borgbackup mailing list