在centos7系统中直接通过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
|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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 |
解决办法:
yum install libdnf-devel
|---|--------------------------| | 1 | yum install libdnf-devel |