Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtnbdbackup: cannot import name 'CONTEXT_BASE_ALLOCATION' from nbd in Debian Bullseye #32

Closed
KALRONG opened this issue Feb 15, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation installation

Comments

@KALRONG
Copy link

KALRONG commented Feb 15, 2022

First thanks for the awesome tool!

Im trying to use it on my debian 11 bullseye, installed from the git repository and followed the steps but Im facing the following error when trying to execute it:

Traceback (most recent call last): File "/usr/local/bin/virtnbdbackup", line 4, in <module> __import__('pkg_resources').run_script('virtnbdbackup==0.43', 'virtnbdbackup') File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 651, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1455, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python3.9/dist-packages/virtnbdbackup-0.43-py3.9.egg/EGG-INFO/scripts/virtnbdbackup", line 31, in <module> File "<frozen zipimport>", line 259, in load_module File "/usr/local/lib/python3.9/dist-packages/virtnbdbackup-0.43-py3.9.egg/libvirtnbdbackup/extenthandler/__init__.py", line 4, in <module> File "<frozen zipimport>", line 259, in load_module File "/usr/local/lib/python3.9/dist-packages/virtnbdbackup-0.43-py3.9.egg/libvirtnbdbackup/extenthandler/extenthandler.py", line 18, in <module> ImportError: cannot import name 'CONTEXT_BASE_ALLOCATION' from 'nbd' (/usr/local/lib/python3.9/dist-packages/nbd/__init__.py)
I have checked the version of the libnbd library in debian and is up to 1.6.1 so this shouldn't be the problem.

Any help will be really appreciated, thanks in advance!

@abbbi
Copy link
Owner

abbbi commented Feb 15, 2022

It seems, you have a python package "nbd" installed in /usr/local/ that is loaded instead of the python3-libnbd binding:

CONTEXT_BASE_ALLOCATION' from 'nbd' (/usr/local/lib/python3.9/dist-packages/nbd/__init__.py)

remove it or consider using a venv environment.

On my system, its having the CONTEXT_BASE_ALLOCATION setting with the nbd module
provided in /usr/lib by the python3-libnbd package:

~ $ dpkg -L python3-libnbd | grep nbd.py
/usr/lib/python3/dist-packages/nbd.py
abi@cefix ~ $ grep CONTEXT_BASE_ALLOCATION /usr/lib/python3/dist-packages/nbd.py
CONTEXT_BASE_ALLOCATION = "base:allocation"
    context, for example "CONTEXT_BASE_ALLOCATION".
    context, for example "CONTEXT_BASE_ALLOCATION".

@abbbi
Copy link
Owner

abbbi commented Feb 15, 2022

see comment -> environment issue.

@abbbi abbbi closed this as completed Feb 15, 2022
@abbbi abbbi added the documentation Improvements or additions to documentation label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation installation
Projects
None yet
Development

No branches or pull requests

2 participants