执行 dnf update 时报错。
错误信息
/usr/local/lib/python3.9/site-packages/dnf.py:15: UserWarning: The DNF Python API is not currently available via PyPI.
Please install it with your distro package manager (typically called
‘python2-dnf’ or ‘python3-dnf’), and ensure that any virtual environments
needing the API are configured to be able to see the system site packages
directory.
warnings.warn(warning_msg)
Traceback (most recent call last):
File “/usr/bin/dnf”, line 61, in
from dnf.cli import main
ModuleNotFoundError: No module named ‘dnf.cli’; ‘dnf’ is not a package
yum install也是报同样错误!
全局查询 dnf 结果如下:
/usr/bin/dnf
/usr/lib/python3.9/site-packages/dnf
/var/lib/dnf
/var/cache/dnf
/etc/dnf
/etc/logrotate.d/dnf
/etc/bash_completion.d/dnf
请求指导什么原因导致的?或者解决问题思路!感谢。