• CentOS7安装dnf后无法运行并报错:ImportError: No module named _conf


    CentOS7通过epel的yum安装dnf后,运行dnf会报以下错误:

    Traceback (most recent call last):

      File "/usr/bin/dnf", line 57, in <module>

        from dnf.cli import main

      File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 30, in <module>

        import dnf.base

      File "/usr/lib/python2.7/site-packages/dnf/base.py", line 29, in <module>

        import libdnf.transaction

      File "/usr/lib64/python2.7/site-packages/libdnf/__init__.py", line 3, in <module>

        from . import conf

      File "/usr/lib64/python2.7/site-packages/libdnf/conf.py", line 17, in <module>

        _conf = swig_import_helper()

      File "/usr/lib64/python2.7/site-packages/libdnf/conf.py", line 16, in swig_import_helper

        return importlib.import_module('_conf')

      File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module

        __import__(name)

    ImportError: No module named _conf

    其实最主要的错误就是最后一条:ImportError: No module named _conf

    github上找到解决办法:

    先升级python:

    yum update python*

    再安装以下软件:

    yum install dnf-data dnf-plugins-core libdnf-devel libdnf python2-dnf-plugin-migrate dnf-automatic

    再次运行dnf,就正常了。
    ————————————————

    转载,原文链接:https://blog.csdn.net/brucemiao/java/article/details/107250962

  • 相关阅读:
    VC combobox
    myitoa()函数
    什么是虚拟显示
    一些itoa()函数
    C语言运算符优先级
    一些小问题
    return 语句会发生的错误
    Sizeof与Strlen的区别与联系
    用异或运算符实现不用第三个临时变量交换两个变量的值
    字符串化运算符#
  • 原文地址:https://www.cnblogs.com/xiaofeng666/p/13280240.html
Copyright © 2020-2023  润新知