简体   繁体   English

virt-manager - 导入错误:没有名为 gi 的模块

[英]virt-manager - ImportError: No module named gi

When I run virt-manager --no-fork on macOS 10.13 High Sierra I get the following:当我在 macOS 10.13 High Sierra 上运行virt-manager --no-fork 时,我得到以下信息:

Traceback (most recent call last):
  File "/usr/local/Cellar/virt-manager/1.5.0/libexec/share/virt-manager/virt-manager", line 31, in <module>
    import gi
ImportError: No module named gi

python version 2.7.6 on macOS macOS 上的 python 版本 2.7.6

Tried mulitple solutions (by googling) none fixed the issue, any ideas how to solve "ImportError: No module named gi" error?尝试了多种解决方案(通过谷歌搜索)都没有解决问题,任何想法如何解决“ImportError:No module named gi”错误?

On debian 9.7 I had the same problem, I fixed:在 debian 9.7 上我遇到了同样的问题,我修复了:

apt install python-gobject-2-dev python-gobject-dev libvirt-glib-1.0-dev python3-libxml2 libosinfo-1.0-dev

在此处输入图片说明

(Arch-linux) I have anaconda installed which breaks virt-manager. (Arch-linux) 我安装了 anaconda,它破坏了 virt-manager。 But there is no need to uninstall it, just renamed anaconda folder to anything else and virt-manager works again.但是不需要卸载它,只需将 anaconda 文件夹重命名为其他任何内容,然后 virt-manager 再次运行。 When need to use anaconda, undo the folder name change.当需要使用anaconda时,撤消文件夹名称更改。 Anaconda modifies PATH environment and when the folder is not present (the trick to rename it) system will look to a standard location. Anaconda 修改 PATH 环境,当文件夹不存在时(重命名它的技巧)系统将查找标准位置。 I think the problem could be related.我认为这个问题可能是相关的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM