Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: virt-manage, ImportError: No module named 'gi'

  1. #11

    Default Re: virt-manage, ImportError: No module named 'gi'

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Can you try to uninstall python3-gobject2, or does it create issues? If not then test again
    Here is the result:

    Code:
    python -c 'import gi; print (gi.__file__)'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'gi'
    
    python2 -c 'import gi; print (gi.__file__)'
    /usr/lib64/python2.7/site-packages/gi/__init__.pyc
    
    python3 -c 'import gi; print (gi.__file__)'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'gi'

  2. #12
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    25,494
    Blog Entries
    15

    Default Re: virt-manage, ImportError: No module named 'gi'

    Quote Originally Posted by Skeletonix View Post
    Here is the result:

    Code:
    python -c 'import gi; print (gi.__file__)'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'gi'
    
    python2 -c 'import gi; print (gi.__file__)'
    /usr/lib64/python2.7/site-packages/gi/__init__.pyc
    
    python3 -c 'import gi; print (gi.__file__)'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'gi'
    Hi
    So is python3-gobject (not python3-gobject2) installed, if not install that and test your virtual manager.

    Also, your using zypper dup for your system and not zypper up?
    Last edited by malcolmlewis; 16-Dec-2018 at 14:08.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #13

    Default Re: virt-manage, ImportError: No module named 'gi'

    Quote Originally Posted by malcolmlewis View Post
    Hi
    So is python3-gobject (not python3-gobject2) installed, if not install that and test your virtual manager.

    Also, your using zypper dup for your system and not zypper up?
    Yes it is installed:

    Code:
    sudo zypper in python3-gobject
    [sudo] password for root: 
    Loading repository data...
    Reading installed packages...
    'python3-gobject' is already installed.
    No update candidate for 'python3-gobject-3.30.4-1.1.x86_64'. The highest available version is already installed.
    Resolving package dependencies...
    
    Nothing to do.
    I do zypper dup quite often.

  4. #14
    Join Date
    Sep 2012
    Posts
    4,788

    Default Re: virt-manage, ImportError: No module named 'gi'

    What says
    Code:
    type -p python3
    python3 -c 'import sys; print(sys.path)'

  5. #15

    Default Re: virt-manage, ImportError: No module named 'gi'

    Quote Originally Posted by arvidjaar View Post
    What says
    Code:
    type -p python3
    python3 -c 'import sys; print(sys.path)'
    That's odd:

    Code:
    type -p python3
    /opt/anaconda3/bin/python3
    
    python3 -c 'import sys; print(sys.path)'
    ['', '/opt/anaconda3/lib/python35.zip', '/opt/anaconda3/lib/python3.5', '/opt/anaconda3/lib/python3.5/plat-linux', '/opt/anaconda3/lib/python3.5/lib-dynload', '/opt/anaconda3/lib/python3.5/site-packages']

  6. #16
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    9,926
    Blog Entries
    1

    Default Re: virt-manage, ImportError: No module named 'gi'

    Quote Originally Posted by Skeletonix View Post
    That's odd:

    Code:
    type -p python3
    /opt/anaconda3/bin/python3
    
    python3 -c 'import sys; print(sys.path)'
    ['', '/opt/anaconda3/lib/python35.zip', '/opt/anaconda3/lib/python3.5', '/opt/anaconda3/lib/python3.5/plat-linux', '/opt/anaconda3/lib/python3.5/lib-dynload', '/opt/anaconda3/lib/python3.5/site-packages']
    You have anaconda installed.
    When you install Anaconda, you no longer use python from the OS (applies to install on all distros), Anaconda installs its own entire ecosystem including python and gives it priority over native OS libraries by prepending its PATH (so any application will find the Anaconda files before it can search for a similar file in the main OS).

    You can uninstall or disable Anaconda by removing the PATH to Anaconda or removing/deleting the entire Anaconda tree of files... or doing both.

    Else, you'll have to go talk to the Anaconda folks about the "gi" module problem...
    Keep in mind though that you'll probably find the Anaconda folks uninterested in your problem, like others similar to Anaconda they are primarily interested in distributing their own entire ecology to support their included applications and don't prioritize outside apps.

    So,
    This is another example of the goodness of installing virtualization and then keeping your HostOS as uncomplicated as possible...
    The problem you ran into is one of many possible similar scenarios, if you had instead installed your Anaconda in a Guest, then you would have isolated the system re-configuration in the Guest, you wouldn't have seen this in your HostOS machine or any other guests.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  7. #17

    Default Re: virt-manage, ImportError: No module named 'gi'

    Quote Originally Posted by tsu2 View Post
    You have anaconda installed.
    When you install Anaconda, you no longer use python from the OS (applies to install on all distros), Anaconda installs its own entire ecosystem including python and gives it priority over native OS libraries by prepending its PATH (so any application will find the Anaconda files before it can search for a similar file in the main OS).

    You can uninstall or disable Anaconda by removing the PATH to Anaconda or removing/deleting the entire Anaconda tree of files... or doing both.

    Else, you'll have to go talk to the Anaconda folks about the "gi" module problem...
    Keep in mind though that you'll probably find the Anaconda folks uninterested in your problem, like others similar to Anaconda they are primarily interested in distributing their own entire ecology to support their included applications and don't prioritize outside apps.

    So,
    This is another example of the goodness of installing virtualization and then keeping your HostOS as uncomplicated as possible...
    The problem you ran into is one of many possible similar scenarios, if you had instead installed your Anaconda in a Guest, then you would have isolated the system re-configuration in the Guest, you wouldn't have seen this in your HostOS machine or any other guests.

    TSU
    Thank you a lot. I've uninstalled the Anaconda and it virt-manager works like a charm.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •