Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ImportError: cannot import name 'OptionParser' - Fedora 28

Any dnf command in terminal inst working, im using Fedora 28

[root@localhost commands]# sudo dnf install fedora-upgrade 
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/cli/__init__.py", line 23, in <module>
    from dnf.cli import commands
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/__init__.py", line 26, in <module>
    from dnf.cli.option_parser import OptionParser
  File "/usr/lib/python3.6/site-packages/dnf/cli/option_parser.py", line 31, in <module>
    from dnf.cli.option_parser import OptionParser
ImportError: cannot import name 'OptionParser'
[root@localhost commands]# dnf upgrade --refresh
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/cli/__init__.py", line 23, in <module>
    from dnf.cli import commands
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/__init__.py", line 26, in <module>
    from dnf.cli.option_parser import OptionParser
  File "/usr/lib/python3.6/site-packages/dnf/cli/option_parser.py", line 31, in <module>
    from dnf.cli.option_parser import OptionParser
ImportError: cannot import name 'OptionParser'

It was working fine, and now dnf is broken. If i change filename of option_parser.py still not working...