ImportError: cannot open shared object file

Asked by Ashish Ranjan on 2019-10-01

I've tried following instructions from other links related to this, but it is still not working.

I also understand that this issue might not be related to duplicity, however if someone could guide me in the right direction it would be really helpful. I've searched StackOverflow, but to no avail.

System: Debian 10
Librsync version 0.9.7-10+b1

Let's say I'm currently in /home/ashish/projects

Steps to reproduce:
1. Install duplicity

sudo apt update
sudo apt install librsync-dev

tar xf duplicity-0.8.04.tar.gz

cd duplicity-0.8.04

python3.7 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install pydrive



2. Run duplicity with pydrive as backend

PYTHONPATH=".:.venv/lib/python3.7/site-packages" ./bin/duplicity . gdocs://<email address hidden>/backups/duplicity


Traceback (most recent call last):
  File "./bin/duplicity", line 55, in <module>
    from duplicity.dup_main import main
  File "/home/ashish/projects/duplicity-0.8.04/duplicity/", line 56, in <module>
    from . import commandline
  File "/home/ashish/projects/duplicity-0.8.04/duplicity/", line 42, in <module>
    from duplicity import backend
  File "/home/ashish/projects/duplicity-0.8.04/duplicity/", line 46, in <module>
    from duplicity import dup_temp
  File "/home/ashish/projects/duplicity-0.8.04/duplicity/", line 31, in <module>
    from duplicity import path
  File "/home/ashish/projects/duplicity-0.8.04/duplicity/", line 47, in <module>
    from duplicity import librsync
  File "/home/ashish/projects/duplicity-0.8.04/duplicity/", line 33, in <module>
    from . import _librsync
ImportError: cannot open shared object file: No such file or directory

$ ldd duplicity/ (0x00007ffd18366000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8a0f9c3000) => not found => /lib/x86_64-linux-gnu/ (0x00007f8a0f7a6000) => /lib/x86_64-linux-gnu/ (0x00007f8a0f407000)
        /lib64/ (0x00007f8a0fdd5000)

I can clearly see that is present in cache using,

$ sudo ldconfig -v | grep librsync

ldconfig: Path `/usr/local/lib' given more than once
ldconfig: Path `/lib/x86_64-linux-gnu' given more than once
ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once
ldconfig: /lib/x86_64-linux-gnu/ is the dynamic linker, ignoring ->

$ ls -la /usr/lib/x86_64-linux-gnu/librsync*

lrwxrwxrwx 1 root root 17 Oct 1 08:28 /usr/lib/x86_64-linux-gnu/ ->
lrwxrwxrwx 1 root root 17 Oct 1 08:28 /usr/lib/x86_64-linux-gnu/ ->
-rw-r--r-- 1 root root 56128 Jun 26 2013 /usr/lib/x86_64-linux-gnu/

$ ldd /usr/lib/x86_64-linux-gnu/ (0x00007fff1eb1b000) => /lib/x86_64-linux-gnu/ (0x00007f124daf2000)
        /lib64/ (0x00007f124e09f000)

Question information

English Edit question
Duplicity Edit question
No assignee Edit question
Last query:
Last reply: will not show up on ldconfig. It's compiled into the duplicity directory during install using It specifically does not follow normal naming conventions, it's only ''. it looks like it was compiled into the venv. Check the directory "/home/ashish/projects/duplicity-0.8.04/duplicity". There should be a file in there.

You might want to run ./ in "/home/ashish/projects/duplicity-0.8.04" to set things up.

Ashish Ranjan (musq) said : #2

So, I repeated the above installation steps, and instead of ./, I ran,

$ ./ install

It ran build scripts and copied stuff into the appropriate .venv directories. A complete dump of this command is provided at

Then I ran,

$ PYTHONPATH=".venv/lib/python3.7/site-packages" ./bin/duplicity . gdocs://<email address hidden>/backups/duplicity

It still gives the same error.
Also, I'm unable to find anywhere in the .venv directory. (I'm using as an alternative to the find command).

$ fd -H librsync


edso ( said : #3

hey Ash,

looks like your problems lies with using venv . either do not use it or find out why loading native libraries might fail in this scenario.

you might wanna try a proven and working method to install multiple duplicity versions as described here (under TIPS)

good luck.. ede/

Ashish Ranjan (musq) said : #4

I'll try your suggestions. Thank you so much for getting back to me.

Can you help with this problem?

Provide an answer of your own, or ask Ashish Ranjan for more information if necessary.

To post a message you must log in.