Ask Your Question

Fedora 29 DNF generates as Python 3 error

asked 2019-01-05 12:12:30 -0600 gravatar image

updated 2019-01-06 04:04:23 -0600

genodeftest gravatar image

(cli output)

root@localhost ~]# dnf
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/dnf/", line 35, in <module>
    from gpg import Context
  File "/usr/lib64/python3.7/site-packages/gpg/", line 101, in <module>
    from . import core
ImportError: cannot import name 'core' from 'gpg' (/usr/lib64/python3.7/site-packages/gpg/

During handling of the above exception, another exception occurred:

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/", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.7/site-packages/dnf/", line 34, in <module>
    from dnf.db.history import SwdbInterface
  File "/usr/lib/python3.7/site-packages/dnf/db/", line 28, in <module>
    from dnf.yum import misc
  File "/usr/lib/python3.7/site-packages/dnf/yum/", line 30, in <module>
    import dnf.crypto
  File "/usr/lib/python3.7/site-packages/dnf/", line 38, in <module>
    import gpgme
ModuleNotFoundError: No module named 'gpgme'
[root@localhost ~]#

Any idea how to fix this? Be aware I'm not an Linux expert.

Thanks, Patrick

edit retag flag offensive close merge delete


I am sorry to say that recovery in this case requires a certain level of Fedora linux experience.

You have to re-install python3-gpg, but that is not possible because dnf doesn't work.

villykruse gravatar imagevillykruse ( 2019-01-06 01:09:03 -0600 )edit

Thanks for you suggestion, which I applied and the outcome is:

[root@localhost Downloads]# rpm --install ./python3-gpg-1.11.1-3.fc29.x86_64.rpm package python3-gpg-1.11.1-3.fc29.x86_64 is already installed

For additional details, YUM generated the same error messages. gravatar ( 2019-01-06 10:00:56 -0600 )edit

rpm --reinstall The package is installed according to rpm, but something is missing so you should re-install it.

villykruse gravatar imagevillykruse ( 2019-01-06 11:37:24 -0600 )edit

It worked fine, the issue is solved. Thank you very much for your help! gravatar ( 2019-01-06 12:37:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-06 04:14:13 -0600

genodeftest gravatar image

You may want to install the package manually by following these steps:

  1. Download the package python3-gpgfor your Fedora version + architecture. For F29: (for other Fedora versions see the howto below)
  2. Open a terminal in the folder where the downloaded RPM file is placed
  3. run sudo rpm --install ./python3-gpg-1.11.1-3.fc29.x86_64.rpm (you may want to change the name accordingly to the name of your RPM file. If this fails, please send us the output of that command.

How to find the URL to the RPM package file:

  1. go to
  2. go to the package. In this case you'll need to get the main package (gpgme) which has a subpackage (python3-gpg). URL:
  3. go to the latest build for your Fedora version (in the main table or under the Builds tab
  4. click on the build URL, in this case
  5. find the binary rpm you want to install, in this case python3-gpg
  6. download the binary for your architecture (if applicable)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-01-05 12:12:30 -0600

Seen: 72 times

Last updated: Jan 06