dnf configuration error?
by nhchauvnu from LinuxQuestions.org on (#4TYJG)
Hi,
I successfully installed Fedora 31 on my laptop. After few days of using, I did something wrong with pip:
pip list | awk '{ printf("pip install %s --upgrade --ignore-installed\n", $1);}' | bash
After that I run 'dnf' and got this error:
===
/usr/local/lib/python3.7/site-packages/rpm.py:15: UserWarning: The RPM Python bindings are not currently available via PyPI.
Please install them with your distro package manager (typically called
'python2-rpm' or 'python3-rpm'), 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 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.7/site-packages/dnf/__init__.py", line 30, in <module>
import dnf.base
File "/usr/lib/python3.7/site-packages/dnf/base.py", line 90, in <module>
class Base(object):
File "/usr/lib/python3.7/site-packages/dnf/base.py", line 501, in Base
_TS_FLAGS_TO_RPM = {'noscripts': rpm.RPMTRANS_FLAG_NOSCRIPTS,
AttributeError: module 'rpm' has no attribute 'RPMTRANS_FLAG_NOSCRIPTS'
===
Now dnf stopped working. Please help me to fix this error. Thanks a lot!!


I successfully installed Fedora 31 on my laptop. After few days of using, I did something wrong with pip:
pip list | awk '{ printf("pip install %s --upgrade --ignore-installed\n", $1);}' | bash
After that I run 'dnf' and got this error:
===
/usr/local/lib/python3.7/site-packages/rpm.py:15: UserWarning: The RPM Python bindings are not currently available via PyPI.
Please install them with your distro package manager (typically called
'python2-rpm' or 'python3-rpm'), 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 57, in <module>
from dnf.cli import main
File "/usr/lib/python3.7/site-packages/dnf/__init__.py", line 30, in <module>
import dnf.base
File "/usr/lib/python3.7/site-packages/dnf/base.py", line 90, in <module>
class Base(object):
File "/usr/lib/python3.7/site-packages/dnf/base.py", line 501, in Base
_TS_FLAGS_TO_RPM = {'noscripts': rpm.RPMTRANS_FLAG_NOSCRIPTS,
AttributeError: module 'rpm' has no attribute 'RPMTRANS_FLAG_NOSCRIPTS'
===
Now dnf stopped working. Please help me to fix this error. Thanks a lot!!