Running 18.04LTS

I've installed Duplicity... it seems to work. I'm running duplicity

I've installed the B2 Command line tool... it works without issue.

I get the following when I try to run a simple backup like the one noted on the backblaze site.

eddie@xxxx:~$ duplicity ~ b2://xxxxxxx:xxxxxxxxxxx@Test-Bucket
BackendException: B2 backend requires B2 Python APIs (pip install b2)

I've installed pip & pip 3 and also the b2 via pip... like this.

pip install b2
pip3 install b2

I ultimately, get the same error. I assume I'm missing some kind of PIP dependency but I have no clue what.

  • My solution for now... use Restic instead.
    – Eddie
    Commented Mar 24, 2019 at 22:00

4 Answers 4


I've had this issue, and it was caused by the b2 package splitting into two parts (b2 and b2sdk), and the sdk part (which duplicity relies on) changing its name as a result of this.

Latest duplicity codebase supports both older and newer version of the library, but older versions such as does not.

What fixed this for me was removing duplicity with apt, and installing it with pip instead (I used python3 instead of python2 as python2 is EOL):

sudo apt remove duplicity
sudo apt install build-essential python3-dev gettext librsync-dev
sudo -H pip3 install duplicity
  • 4
    This fixed it for me. Even though it is already mentioned in the answer, I would add that you need to install b2sdk with pip3 install b2sdk (took me a minute to carefully read the new error message)
    – fronk
    Commented Oct 13, 2020 at 20:58
  • Fixed it for me thank you!!!
    – Mr. T
    Commented Feb 23, 2021 at 20:20
  • I got a similar problem today - dang "snap" updated duplicity and things started crashing in general. Switched to apt version and that began complaining about missing b2sdk even if pip kept saying that it's installed, etc. Ditching all that and taking your answers' path solved it. Tnx.
    – silverdr
    Commented Mar 8, 2022 at 10:49

An update:

I learned that the B2 Application key is not supported. I needed to create a Master Application key instead. It did not contain any slashes and I eventually got connected with this result: How to fix Duplicity B2 (Backblaze) error

It says that there is a bug that has been fixed in 0.7.18. According to the reply this is available in a ppa. It seems not in the standard repositories for the 18.04 as I did not get it with sudo apt upgrade.

  • Unfortunately, I am running I upgraded in hopes that would help... nope.
    – Eddie
    Commented Mar 28, 2019 at 23:17

There's a discussion here on this issue. They recommend

revert to b2sdk==1.7.0 until duplicity 0.8.20 is released

pip3 install -U b2sdk==1.7.0

Also at the bottom, it's suggested to install via apt, i.e.

sudo apt-get install python3-b2sdk

Which I think is the preferred option for adding packages to the system python, if you're installing packages via pip it's probably best if they're installed into a virtualenv.


I faced the same issue. I got with some progress, but not fully resolved the issue. I am running on Ubuntu 18.04 LTS as well. The duplicity version is 0.7.17 (straight from the default repository).

Before installing the pip and adding the b2 I did add (apt install) some other packages that were suggested by the package manager at the time of installing duplicity. Namely: python-pexpect, python-urllib3 and python-oauthlib.

With these installed I run the duplicity again. I do not get the BackendException on B2 Python API any more.

However, I faced another error message (another issue?):

InvalidBackendURL: Syntax error (port) in: b2://xxxxxxxx:YYYYY/yyy@hv-homes/ AFalse BNone xxxxxxxxx:YYYYY

It is perhaps worth mentioning that my application key contains "/" and the error message repeats it until the "/"-sign. I do not know if this error relates to the same B2 API or is something else. At least I do not have a request to install b2 anymore :-)

  • Hi Mika. I think that you should open a separate question and reference this one, because you ran into a new error message that the O.P. didn't have, as you suggested, it maybe a separate issue.
    – Hee Jin
    Commented Mar 26, 2019 at 22:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .