Ask Your Question
1

Fedora 29 DNF generates as Python 3 error

asked 2019-01-05 12:12:30 -0500

Patrick.be gravatar image

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

genodeftest gravatar image

(cli output)

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

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/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 34, in <module>
    from dnf.db.history import SwdbInterface
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 28, in <module>
    from dnf.yum import misc
  File "/usr/lib/python3.7/site-packages/dnf/yum/misc.py", line 30, in <module>
    import dnf.crypto
  File "/usr/lib/python3.7/site-packages/dnf/crypto.py", 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

Comments

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 -0500 )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.

Patrick.be gravatar imagePatrick.be ( 2019-01-06 10:00:56 -0500 )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 -0500 )edit

It worked fine, the issue is solved. Thank you very much for your help!

Patrick.be gravatar imagePatrick.be ( 2019-01-06 12:37:14 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

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

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: https://koji.fedoraproject.org/koji/b... (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 https://apps.fedoraproject.org/packages/
  2. go to the package. In this case you'll need to get the main package (gpgme) which has a subpackage (python3-gpg). URL: https://apps.fedoraproject.org/packag...
  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 https://koji.fedoraproject.org/koji/b...
  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
0

answered 2019-03-19 06:51:08 -0500

Hi! I get exactly the same error as reported above and cannot fix it following the comments above:

The problem:

[root@maupiti Downloads]# dnf

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 29, in <module> import libdnf.transaction ModuleNotFoundError: No module named 'libdnf'

Now, I apply the fix as stated above: - I download python3-gpg-1.11.1-3.fc29.x86_64.rpm from here. - I tried to install with rpm:

[root@maupiti Downloads]# rpm --install ./python3-gpg-1.11.1-3.fc29.x86_64.rpm error: Failed dependencies: gpgme(x86-64) = 1.11.1-3.fc29 is needed by python3-gpg-1.11.1-3.fc29.x86_64

Then, I downloaded gpgme-1.11.1-3.fc29.x86_64.rpm from the same repository (https://koji.fedoraproject.org/koji/b...) and now I get:

[root@maupiti Downloads]# rpm --install gpgme-1.11.1-3.fc29.x86_64.rpm

    package gpgme-1.12.0-1.fc29.x86_64 (which is newer than gpgme-1.11.1-3.fc29.x86_64) is already installed
    file /usr/bin/gpgme-json from install of gpgme-1.11.1-3.fc29.x86_64 conflicts with file from package gpgme-1.12.0-1.fc29.x86_64
    file /usr/lib64/libgpgme.so.11 from install of gpgme-1.11.1-3.fc29.x86_64 conflicts with file from package gpgme-1.12.0-1.fc29.x86_64
    file /usr/share/doc/gpgme/AUTHORS from install of gpgme-1.11.1-3.fc29.x86_64 conflicts with file from package gpgme-1.12.0-1.fc29.x86_64
    file /usr/share/doc/gpgme/ChangeLog from install of gpgme-1.11.1-3.fc29.x86_64 conflicts with file from package gpgme-1.12.0-1.fc29.x86_64
    file /usr/share/doc/gpgme/NEWS from install of gpgme-1.11.1-3.fc29.x86_64 conflicts with file from package gpgme-1.12.0-1.fc29.x86_64
    file /usr/share/doc/gpgme/VERSION from install of gpgme-1.11.1-3.fc29.x86_64 conflicts with file from package gpgme-1.12.0-1.fc29.x86_64

I tried to do 'rpm --erase' of these packages but I break dependencies....

Please help! the system is pretty useless without a working dnf / yum !

m

edit flag offensive delete link more

Comments

No, you got a different problem, so create a new question for that. In the original gpgme was missing. In your case libdnf is missing.

villykruse gravatar imagevillykruse ( 2019-03-19 15:19:02 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 216 times

Last updated: Jan 06