Make a single global .so module available in virtualenv

36 views Asked by At

I have a program that needs to use the dbm.gnu module. This requires the external python3-gdbm debian package which is installed globally, but it's not available inside the virtualenv. As far as I can tell, this is not available to install via pip. I tried copying the file from /usr/lib/python3.10/lib-dynload/_gdbm.cpython-310-x86_64-linux-gnu.so to venv/lib/python3.10/lib-dynload/, but the module is still not importable. Is there a way to somehow make this package available inside the virtualenv?

Using the --system-site-packages option of the venv module is not possible, because there are conflicts between some other global packages and the ones that are to be installed in the virtualenv.

0

There are 0 answers