ModuleNotFoundError: No module named 'virtManager'

Mario Marietto marietto2008 at gmail.com
Fri May 28 23:12:44 UTC 2021


Hello.
I've tried to compile a custom libvirt+libvirt-python+virt-manager stack
following these tutorials :

https://developer.ibm.com/.../compiling-libvirt-and-qemu/
<https://developer.ibm.com/technologies/linux/tutorials/compiling-libvirt-and-qemu/?fbclid=IwAR2plFzMwUYhRtHl0SZRX8Ox1nIc09F0pNF-_XYhZWV_OsueyivdmWV0ets>
https://gist.github.com/.../9e06ee32431d9a8f6d9bec3a0db35634
<https://gist.github.com/ffledgling/9e06ee32431d9a8f6d9bec3a0db35634?fbclid=IwAR1lRJtcxTwTdrLfx_h41aZFzY_xYCdqPwp02EIiOJ2ztcxVc4JT-FxEUtk>

on my jetson nano (arm64 + ubuntu 18.04)

In details,these are the steps that I did :

1) Install Git and clone both upstream libvirt and qemu repos.

git clone https://github.com/qemu/qemu.git
<https://l.facebook.com/l.php?u=https%3A%2F%2Fgithub.com%2Fqemu%2Fqemu.git%3Ffbclid%3DIwAR1HZjfxJLIGKULJneZhYY8drICb9AjZMY7BGbIcxrsljpg_exiorE0GC4I&h=AT1qgadNVCO6vef93eMQaj_Npuwj_Kg3iaH6W7acKhWbh61rSJMnwIlhaSdQL_925Fqx2zjuLjQH3IpMz9tT1JBKowrBPOwZmwiVnnYAg3jq14UG-8DKfJiDcA&__tn__=-UK-R&c[0]=AT2aXw9EVHE3mfv3jPdV2v6aTd5eC8t8a_4O_m-ZpY7Li8GN_tDit6AQegYU7DF-E4q6tqQ3oi-WWrY0VUHxzdUhi93yll04p-N051vtR9rzeZJC-5RDzGGBoGSvx5OfoG2O>
git clone https://github.com/libvirt/libvirt.git
<https://github.com/libvirt/libvirt.git?fbclid=IwAR3_TkDD5wp8qxhpImu9RTOcTX8IDmQHdCXV0ilNGtJVTSzXb9UopgcxA1c>

2) Configure and build the qemu code and then install the qemu code. The
make install command creates the binary files in the /usr/local directory.

cd qemu
mkdir -p build
cd build
../configure --prefix=/usr/local --target-list=aarch64-softmmu,arm-softmmu
--enable-guest-agent --enable-vnc --enable-vnc-jpeg --enable-vnc-png
--enable-kvm --enable-spice --enable-sdl --enable-gtk
--enable-virglrenderer --enable-opengl
make -j
sudo make install

3) Configure and build libvirt and then install the libvirt code.
Libvirt_build contains the log and configuration files for the daemons and
the qemu driver.

cd ~/Desktop/zi/Work/I9/libvirt
mkdir -p libvirt_build
cd libvirt
$ meson build --prefix=~/Desktop/zi/Work/I9/libvirt/libvirt_build
$ ninja -C build
$ sudo ninja -C build install

4) Run the following commands from the $HOME/libvirt/build directory to
start the libvirt daemon (libvirtd).

~/Desktop/zi/Work/I9/libvirt/build# sudo ./run src/virtlockd & sudo ./run
src/virtlogd & sudo ./run src/libvirtd

5) Here is the output of the virt process running in my system.

root at zi-desktop:~/Desktop/zi/Work/I9/libvirt# ps axf | grep virt

30925 pts/0 S 0:00 | \_ sudo ./run src/virtlockd
30929 pts/0 S 0:00 | | \_ src/virtlockd
30926 pts/0 S 0:00 | \_ sudo ./run src/virtlogd
30930 pts/0 S 0:00 | | \_ src/virtlogd
31201 pts/0 S 0:00 | \_ sudo ./run src/virtlockd
31205 pts/0 S 0:00 | | \_ src/virtlockd
31202 pts/0 S 0:00 | \_ sudo ./run src/virtlogd
31207 pts/0 S 0:00 | | \_ src/virtlogd
31204 pts/0 S+ 0:00 | \_ sudo ./run src/libvirtd
31206 pts/0 Sl+ 0:01 | \_ src/libvirtd
4732 pts/1 S+ 0:00 \_ grep --color=auto virt

31413 ? S 0:00 /usr/sbin/dnsmasq
--conf-file=/root/Desktop/zi/Work/I9/libvirt/libvirt_build/var/lib/libvirt/dnsmasq/default.conf
--leasefile-ro
--dhcp-script=/home/zi/Desktop/Work/I9/libvirt/build/src/libvirt_leaseshelper

31426 ? S 0:00 \_ /usr/sbin/dnsmasq
--conf-file=/root/Desktop/zi/Work/I9/libvirt/libvirt_build/var/lib/libvirt/dnsmasq/default.conf
--leasefile-ro
--dhcp-script=/home/zi/Desktop/Work/I9/libvirt/build/src/libvirt_leaseshelper

In this process, everything being run from ‘/usr/sbin’ is from the system
based libvirt OS installation. The virt process that has been run as sudo
is from custom libvirt. This indicates that you can have system-based
libvirtd daemon and custom libvirtd daemon both running at the same time.

6) Install libvirt-python next because we need to use virt-manager and that
requires libvirt python bindings

~/Desktop/zi/Work/I9/libvirt-python-7.3.0# export
PKG_CONFIG_PATH=/home/zi/Desktop/Work/I9/libvirt/libvirt_build/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH

~/Desktop/zi/Work/I9/libvirt-python-7.3.0# python setup.py build
# python setup.py install --root
/home/zi/Desktop/Work/I9/libvirt/libvirt_build
ok

7) Then I've installed a custom virt-manager into the same location :

# cp -r virt-manager-3.2.0 /home/zi/Desktop/Work/I9/libvirt/src
# cd virt-manager-3.2.0
# python setup.py install --root
/home/zi/Desktop/Work/I9/libvirt/libvirt_build

Finally I've put all in my $PATH:

CUSTOM_ROOT=/home/zi/Desktop/Work/I9/libvirt/libvirt_build
export PATH=$CUSTOM_ROOT/bin:$PATH
export PATH=$CUSTOM_ROOT/usr/bin:$PATH

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/zi/Desktop/Work:/root/Desktop/turbovnc/jtx1_remote_access/tmp/turbovnc-build/bin/:/root/Desktop/turbovnc/jtx1_remote_access/tmp/virtualgl-build/bin:/home/zi/Desktop/Work/I9/libvirt/libvirt_build/bin:/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin

# /home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin# ./virt-manager

Unfortunately,the virt-manager does not work.

/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin# ./virt-manager

Traceback (most recent call last):
File "./virt-manager", line 6, in <module>
from virtManager import virt manager
ModuleNotFoundError: No module named 'virtManager'

/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin# virt-manager

Traceback (most recent call last):
File "/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin/virt-manager",
line 6, in <module>
from virtManager import virt manager
ModuleNotFoundError: No module named 'virtManager'

What can I do now ?

-- 
Mario.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20210529/776d63c4/attachment.htm>


More information about the virt-tools-list mailing list