Ask Your Question

How to fix ImportError: No module named librepo [closed]

asked 2015-05-29 19:58:35 -0600

Falcon2_0 gravatar image

updated 2015-06-01 05:41:38 -0600

FranciscoD_ gravatar image

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/", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/", 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/ (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/ (Input/output error)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by FranciscoD_
close date 2015-06-01 05:40:31.642878



can you post

rpm -Vv python-librepo
geforce gravatar imagegeforce ( 2015-05-30 08:22:29 -0600 )edit

That's pretty weird. "Input/output error" usually signals a hardware problem. Maybe the hard drive is damaged or dying. It seems to be having trouble loading the files belonging to the corresponding python module (librepo).

rg3 gravatar imagerg3 ( 2015-05-30 15:45:07 -0600 )edit

@rg3, when I do cd /usr/lib64/python2.7/site-packages/librepo and then do ls -a, only . and .. are returned, so it probably means it's not there.

Falcon2_0 gravatar imageFalcon2_0 ( 2015-05-30 16:23:14 -0600 )edit

minecraft? sorry but isn't exist available rpm for Fedora. Please read it:

davidva gravatar imagedavidva ( 2015-05-30 19:47:18 -0600 )edit

OP has answered below that a reinstallation fixed it. Probably an error while creating boot media. Closing.

FranciscoD_ gravatar imageFranciscoD_ ( 2015-06-01 05:41:13 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2015-05-30 21:18:40 -0600

Falcon2_0 gravatar image

I think this was a problem with my boot usb that I installed Fedora with. I redownloaded Fedora 22 and installed it and the error went away.

edit flag offensive delete link more

answered 2015-05-29 21:28:40 -0600

That looks like a bug in yum. But, the 'dnf' command replaces 'yum' in Fedora 22. This command will do what you want:

dnf search minecraft

But the answer is 'no', because minecraft is not open source, so it cannot be included in Fedora.

It is not hard, however, to download the Minecraft.jar from and run it on Fedora:

java -jar Minecraft.jar

It works great for me.

edit flag offensive delete link more


You'll want to install OptiFine to speed it up, just like on Windows.

Bill Chatfield gravatar imageBill Chatfield ( 2015-05-29 21:29:56 -0600 )edit

This question wasn't on how to install minecraft, I figured I could just download it from the site like I did on Ubnutu, the question was how to fix the ImportError: No module named librepo

Falcon2_0 gravatar imageFalcon2_0 ( 2015-05-29 23:33:54 -0600 )edit

I have a module called librepo in /usr/lib64/python2.7/site-packages/librepo. The error could occur if you're missing that module. It is supplied by the python-librepo package. You could try installing that package, but if you can't install anything because of this error, it's going to be hard to fix. It's a catch 22 situation. You may have to download the .rpm and install it like this: rpm -ivh python-librepo.rpm

[bill@billslaptop ~]$ rpm -q -i -f /usr/lib64/python2.7/site-packages/librepo/ Name : python-librepo Version : 1.7.13 Release : 1.fc22 Architecture: x86_64

Bill Chatfield gravatar imageBill Chatfield ( 2015-05-30 00:28:27 -0600 )edit

Where would I download that package without dnf?

Falcon2_0 gravatar imageFalcon2_0 ( 2015-05-30 15:46:32 -0600 )edit

answered 2015-05-29 21:31:07 -0600

florian gravatar image

updated 2015-05-29 23:10:55 -0600

yum has been replaced with dnf in Fedora22, so instead of using yum, just use dnf

If you want to check for available software packages, use the command dnf search <packagename> or dnf list <packagename>. In your case: sudo dnf search minecraft.

There is no such package available in F22 repos.

I'd suggest, you start your research from here. Or you visit and download the .jar archive from there...

edit flag offensive delete link more


Thanks for the response, but I still get the ImportError: No module named librepo error. :(

Falcon2_0 gravatar imageFalcon2_0 ( 2015-05-29 21:43:49 -0600 )edit

@Falcon2_0: while executing what command? yum install minecraft? Not that it will be successful but what happens if you run sudo dnf install minecraft?

florian gravatar imageflorian ( 2015-05-29 22:17:05 -0600 )edit

@Florian I get the same error excluding everything before the line break.

Falcon2_0 gravatar imageFalcon2_0 ( 2015-05-29 23:32:33 -0600 )edit

answered 2015-05-31 01:59:51 -0600

geforce gravatar image

updated 2015-05-31 02:03:13 -0600

So it has missing files, reinstall it with this command (--force is needed as package is already installed).

rpm -Uvh --force
edit flag offensive delete link more

Question Tools


Asked: 2015-05-29 19:58:35 -0600

Seen: 2,507 times

Last updated: May 31 '15