Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to fix ImportError: No module named librepo

I just installed Fedora 22, and this is my first time using Fedora. Since I wanted to see if minecraft was in the repositories, I did the command

yum install minecraft

and got this result

Yum command has been deprecated, redirecting to '/usr/bin/dnf install minecraft'.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run:
'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'

Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
ImportError: No module named librepo

How to fix ImportError: No module named librepo

I just installed Fedora 22, and this is my first time using Fedora. Since I wanted to see if minecraft was in the repositories, I did the command

yum install minecraft

and got this result

Yum command has been deprecated, redirecting to '/usr/bin/dnf install minecraft'.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run:
'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'

Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
ImportError: No module named librepo

EDIT: Someone asked what

rpm -Vv python-librepo

returns. It returns this:

missing     /usr/lib64/python2.7/site-packages/librepo (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/__init__.py (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/__init__.pyc (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/__init__.pyo (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/_librepomodule.so (Input/output error)

How to fix ImportError: No module named librepo

I just installed Fedora 22, and this is my first time using Fedora. Since I wanted to see if minecraft was in the repositories, I did the command

yum install minecraft

and got this result

Yum command has been deprecated, redirecting to '/usr/bin/dnf install minecraft'.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run:
'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'

Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
ImportError: No module named librepo

EDIT: Someone asked what

rpm -Vv python-librepo

returns. It returns this:

missing     /usr/lib64/python2.7/site-packages/librepo (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/__init__.py (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/__init__.pyc (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/__init__.pyo (Input/output error)
missing     /usr/lib64/python2.7/site-packages/librepo/_librepomodule.so (Input/output error)