LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 05-29-2021, 08:22 AM   #1
marietto
Member
 
Registered: Aug 2010
Posts: 96

Rep: Reputation: 17
I get the ModuleNotFoundError: No module named 'virtManager' error compiling a custom libvirt-python+virt-manager stack


Hello.

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

https://developer.ibm.com/technologi...virt-and-qemu/

https://gist.github.com/ffledgling/9...9bec3a0db35634

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.

Code:
 git clone https://github.com/qemu/qemu.git

    git clone https://github.com/libvirt/libvirt.git
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.

Code:
 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
2.1) qemu 6.0 has been detected correctly at this poiint :

Code:
#qemu-system-aarch64 --version

    QEMU emulator version 6.0.50 (v6.0.0-1145-g7258034ab4) Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
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.

Code:
cd ~/Desktop/zi/Work/I9/libvirt

    mkdir -p libvirt_build

    cd ~/Desktop/zi/Work/I9/libvirt

    $ meson libvirt_build

    $ ninja -C libvirt_build

    $ ninja -C libvirt_build install
4) Run the following commands from /root/Desktop/zi/Work/I9/libvirt/libvirt_build directory to start the libvirt daemon (libvirtd).

Code:
 ~/Desktop/zi/Work/I9/libvirt/libvirt_build# sudo ./run src/virtlockd & sudo ./run src/virtlogd & sudo ./run src/libvirtd
5) Here is the ouput of the virt process running in my system :

Code:
~/Desktop/zi/Work/I9/libvirt_build# 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

    ~/Desktop/zi/Work/I9/libvirt/libvirt_build# sudo ./run tools/virsh list --all

    Id Name State
6) Install libvirt-python next because I need to use virt-manager and that requires libvirt python bindings

Code:
CUSTOM_ROOT=/home/zi/Desktop/Work/I9/libvirt/libvirt_build

    mkdir - p $CUSTOM_ROOT/src

    #cp -r /root/Scrivania/Scrivania/Dati/Data/Nano/I9/Tools/virt-manager-3.2.0 /home/zi/Desktop/Work/I9/libvirt/libvirt_build/src

    ~/Desktop/zi/Work/I9/libvirt/libvirt_build/src/libvirt-python-7.3.0# export LD_LIBRARY_PATH=$CUSTOM_ROOT/lib

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

    ~/Desktop/zi/Work/I9/libvirt/libvirt_build/src/libvirt-python-7.3.0# python setup.py build

    ~/Desktop/zi/Work/I9/libvirt/libvirt_build/src/libvirt-python-7.3.0# python setup.py install --root $CUSTOM_ROOT

    LOG : https://pastebin.ubuntu.com/p/SVHkDhXs2s/
7) Then I've installed a custom virt-manager into the same location and it should pick up the newer python bindings :

Code:
    #cp -r /root/Scrivania/Scrivania/Dati/Data/Nano/I9/Tools/virt-manager-3.2.0 /home/zi/Desktop/Work/I9/libvirt/libvirt_build/src

    #cd virt-manager-3.2.0

    #python setup.py install --root $CUSTOM_ROOT

    LOG : https://pastebin.ubuntu.com/p/bCn5Q3yHVX/
8) Finally I put all in my $PATH :

Code:
 export PATH=$CUSTOM_ROOT/bin:$PATH

    export PATH=$CUSTOM_ROOT/usr/bin:$PATH

    #echo $PATH

    /home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin:/home/zi/Desktop/Work/I9/libvirt/libvirt_build/bin:/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/
9) Unfortunately,when I try to run virt-manager with this command,it does not work :

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

Traceback (most recent call last): File "/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin/virt-manager", line 6, in from virtManager import virt manager ModuleNotFoundError: No module named 'virtManager'
Where is the mistake ? very thanks.

Last edited by marietto; 05-29-2021 at 08:24 AM.
 
Old 05-31-2021, 12:26 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

it seems that you didn't add the installation location to you $PYTHONPATH.

Evo2.
 
Old 06-01-2021, 08:37 AM   #3
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
Hello.

thanks. I tried,but it didn't work :

Quote:
root@zi-desktop:~/Desktop/zi/Work/I9/libvirt/libvirt_build/usr/bin# export PYTHONPATH=$PYTHONPATH:/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/share/virt-manager

root@zi-desktop:~/Desktop/zi/Work/I9/libvirt/libvirt_build/usr/bin# ls /home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/share/virt-manager

icons ui virtinst virtManager

root@zi-desktop:~/Desktop/zi/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 virtmanager
File "/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/share/virt-manager/virtManager/virtmanager.py", line 19, in <module>
from virtinst import BuildConfig
File "/usr/share/virt-manager/virtinst/__init__.py", line 18, in <module>
from virtcli import CLIConfig as _CLIConfig
File "/usr/share/virt-manager/virtcli/__init__.py", line 3, in <module>
from .cliconfig import CLIConfig
File "/usr/share/virt-manager/virtcli/cliconfig.py", line 24, in <module>
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
 
Old 06-01-2021, 06:30 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by marietto View Post
Hello.

thanks. I tried,but it didn't work :
I think it did work. You no longer get the error:
Code:
No module named 'virtManager'
Now it can't find ConfigParser which should come with python2 and should be instalable with your package manager for python3.

Evo2.
 
Old 06-03-2021, 05:10 PM   #5
marietto
Member
 
Registered: Aug 2010
Posts: 96

Original Poster
Rep: Reputation: 17
# python --version

Python 3.6.9


I've jumped back to the previous error


# CUSTOM_ROOT=/home/zi/Desktop/Work/I9/libvirt/libvirt_build

# export LD_LIBRARY_PATH=$CUSTOM_ROOT/lib

# export PKG_CONFIG_PATH=$CUSTOM_ROOT/lib/aarch64-linux-gnu/pkgconfig

# export PATH=$CUSTOM_ROOT/usr/bin:$PATH

# echo $PATH

/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin:/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/:/root/Desktop/Docker-Images/dockerpi:/root

root@zi-desktop:/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 virtmanager
ImportError: cannot import name 'virtmanager'

# export PYTHONPATH=$PYTHONPATH:/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/share/virt-manager

root@zi-desktop:/home/zi/Desktop/Work/I9/libvirt/libvirt_build/usr/bin# python virt-manager

Traceback (most recent call last):
File "virt-manager", line 6, in <module>
from virtManager import virtmanager
ImportError: cannot import name 'virtmanager'

Last edited by marietto; 06-03-2021 at 05:11 PM.
 
  


Reply

Tags
compilation, python, ubuntu 18.04, virtualization



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] python3, pycharm ModuleNotFoundError: No module named 'wx' kaz2100 Linux - Software 3 05-25-2021 06:02 PM
[SOLVED] ModuleNotFoundError: No module named 'html.entities'; 'html' is not a package (python3 error) kaz2100 Linux - Software 3 05-25-2021 12:48 AM
[SOLVED] apt install broken - ConfigParser import SafeConfigParser ModuleNotFoundError: No module named 'ConfigParser' anon052 Linux - Newbie 16 08-06-2020 06:11 AM
[SOLVED] virt-manager fails to start with "ImportError: No module named libvirt" glupa4e Slackware 2 11-25-2015 02:04 PM
LXer: Hacking libvirt/virsh/virt-manager/virt-install at Xen 4.0 Dom0 on top of Ubunt LXer Syndicated Linux News 0 05-06-2010 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration