Specify which version of python duplicity should use

Unix & Linux Asked by JacobTheDev on January 2, 2022

I’ve got a backup script that utilizes duplicity to upload to Dropbox. It’s erroring out because the dropbox-python-sdk version required, 6.9.0, uses the keyword async which is now reserved in python3. I have both python3 and python2.7 installed on my system, but duplicity is automatically using python3. How can I configure my system, this script, or duplicity, to specifically run python2.7 (in this case, /usr/bin/pthyon)?

One Answer

I don't know duplicity but if it's only 1 script or a combination of a tiny number of scripts then changing #!/usr/bn/python to #!/usr/bin/python3 on the 1st line of the script should do the trick.

Otherwise you can change the symlink /usr/bin/python points to. On most distro's there is a 'clean' way to do this but the following will work everywhere:
sudo ln -sf $(which python3) /usr/bin/python

Answered by Garo on January 2, 2022

Add your own answers!

Related Questions

Base64 encoded ignition file gets messed up

1  Asked on August 15, 2020 by michael-stbich


Weird textures on KDE Plasma 5.0

0  Asked on August 11, 2020 by rushisrinivas-k


How do I syntax check a Zsh script?

1  Asked on August 9, 2020 by akhil-jalagam


How can I swap my two screens, left to right?

5  Asked on August 4, 2020 by ripper234


Adding suffix to filename during for loop in bash

1  Asked on August 3, 2020 by mishal-ahmed


Why are aliases skipped if escaped?

2  Asked on August 2, 2020


Why can’t I type a g̃ the same way I type ñ?

1  Asked on July 29, 2020 by mmaluff


Custom logrotate with hostnames

0  Asked on July 29, 2020 by gwynn


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir