Change:
installPhase = '' python setup.py install --prefix=$out wrapProgram $out/bin/duplicity  <del> --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pycrypto}):$(toPythonPath ${ecdsa}):$(toPythonPath ${paramiko}):$(toPythonPath ${boto}):$(toPythonPath ${lockfile})"  </del> <ins> --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${idna}):$(toPythonPath ${cffi}):$(toPythonPath ${ipaddress}):$(toPythonPath ${pyasn1}):$(toPythonPath ${six}):$(toPythonPath ${enum}):$(toPythonPath ${setuptools}):$(toPythonPath ${cryptography}):$(toPythonPath ${pycrypto}):$(toPythonPath ${ecdsa}):$(toPythonPath ${paramiko}):$(toPythonPath ${boto}):$(toPythonPath ${lockfile})"  </ins> --prefix PATH : "${stdenv.lib.makeBinPath [ gnupg ncftp rsync ]}" wrapProgram $out/bin/rdiffdir  <del> --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pycrypto}):$(toPythonPath ${ecdsa}):$(toPythonPath ${paramiko}):$(toPythonPath ${boto}):$(toPythonPath ${lockfile})" </del> <ins> --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${idna}):$(toPythonPath ${cffi}):$(toPythonPath ${ipaddress}):$(toPythonPath ${pyasn1}):$(toPythonPath ${six}):$(toPythonPath ${enum}):$(toPythonPath ${setuptools}):$(toPythonPath ${cryptography}):$(toPythonPath ${pycrypto}):$(toPythonPath ${ecdsa}):$(toPythonPath ${paramiko}):$(toPythonPath ${boto}):$(toPythonPath ${lockfile})" </ins> ''; buildInputs = [ python librsync makeWrapper setuptools ];

Discussion:
When running duply with the sftp backend it throws the error BackendException: Could not initialize backend: No module named 09:42:15.986 Task 'BKP' failed with exit code '23'. System: 16.09pre89501. (Flounder) Nix version: 1.11.2 Nixpkgs version: 16.09pre89501.
is the backend missing or is it using wrong version of cryptography?
if cryptography isn't as a buildInput I'm not surprised it won't work. could you test cc maintainer
well, I accidentally merged it already, so you can try master as well.
Using FRidh/nixpkgs like this nix-shell --pure -p duply --run 'duply test create; mkdir -p source; mkdir -p target; echo SOURCE="$PWD/source TARGET=sftp://localhost/$PWD/target TARGET_PASS=''" ; duply test backup' -I still gives the same error I'm afraid.
I suppose it is duplicity that needs this library.
cc maintainers
FTR, as a workaround I tried installing older versions of duply/duplicity using but still got the same error. (Which of course is weird because it worked for me until days ago.)
Sorry, must have mixed something up yesterday - I was able to install duplicity-0.7.06/duply-1.9.2 from nixpkgs just now and backup is running. Meaning I have a workaround for now.
Sounds like this has been fixed.
How? Where?
I don't see how this is fixed. The nix-shell invocation from the description still throws the same error.
Any ideas here? With a pointer or to I would be willing to try and fix it myself, but I'm not sure where to start.
If I am correct, calls , so the error we're seeing is in , and not in (therefore my fix in didn't work). The package doesn't seem to have , only , so I imagine that to be the problem.
Thanks! That was the right direction. There were a couple more missing dependencies but I managed to sort them out.