Bug 1599069
Summary: | Latest python3 updates broke dnf / yum. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David Hill <dhill> |
Component: | dnf | Assignee: | rpm-software-management |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | urgent | Docs Contact: | |
Priority: | urgent | ||
Version: | rawhide | CC: | dasigisarath, dhill, dmach, infra-sig, john.ellson, jonstanley, mblaha, mhatina, mhroncok, packaging-team-maint, rbarlow, rpm-software-management, vmukhame |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-08-14 07:09:51 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
David Hill
2018-07-08 13:06:24 UTC
It's like if python3 would no longer be able to find the modules installed in the previous versions . If I create a symlink in /usr/lib/python3.7/site-packages, dnf "works" . It works until I hit this: [root@zappa usr]# 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 31, in <module> import dnf.base File "/usr/lib/python3.7/site-packages/dnf/base.py", line 29, in <module> from dnf.comps import CompsQuery File "/usr/lib/python3.7/site-packages/dnf/comps.py", line 32, in <module> import dnf.util File "/usr/lib/python3.7/site-packages/dnf/util.py", line 29, in <module> import dnf.callback File "/usr/lib/python3.7/site-packages/dnf/callback.py", line 22, in <module> import dnf.yum.rpmtrans File "/usr/lib/python3.7/site-packages/dnf/yum/rpmtrans.py", line 25, in <module> import rpm File "/usr/lib64/python3.7/site-packages/rpm/__init__.py", line 38, in <module> from rpm._rpm import * ModuleNotFoundError: No module named 'rpm._rpm' [root@zappa rpm]# python3.7 Python 3.7.0 (default, Jun 28 2018, 07:54:44) [GCC 8.1.1 20180626 (Red Hat 8.1.1-3)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import rpm._rpm Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.7/site-packages/rpm/__init__.py", line 38, in <module> from rpm._rpm import * ModuleNotFoundError: No module named 'rpm._rpm' >>> quit Use quit() or Ctrl-D (i.e. EOF) to exit >>> [root@zappa rpm]# python3.6 Python 3.6.3 (default, Jan 4 2018, 16:40:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import rpm._rpm So it works with python3.6 but not python3.7 . Looks like the packages in fedora-devel are lacking the dnf/rpm/libdnf modules. Is that my mistake ? Could you please run: $ rpm -q python3 $ rpm -q python37 $ rpm -q dnf $ rpm -q python3-dnf Also: $ rpm -qf /usr/bin/dnf $ rpm -qf /usr/bin/python3 And: $ head -n2 /usr/bin/dnf $ rpm -qf /usr/lib64/python3.7/site-packages/rpm/__init__.py $ rpm -qf /usr/lib64/python3.7/site-packages/rpm/_rpm.cpython* [root@zappa site-packages]# rpm -q python3 python3-3.7.0-1.fc29.x86_64 [root@zappa site-packages]# rpm -q python37 package python37 is not installed [root@zappa site-packages]# rpm -q dnf dnf-3.0.1-1.fc29.noarch [root@zappa site-packages]# rpm -q python3-dnf python3-dnf-3.0.1-1.fc29.noarch [root@zappa site-packages]# rpm -qf /usr/bin/dnf dnf-3.0.1-1.fc29.noarch [root@zappa site-packages]# rpm -qf /usr/bin/python3 python3-3.7.0-1.fc29.x86_64 [root@zappa site-packages]# head -n2 /usr/bin/dnf #!/usr/bin/python3 # The dnf executable script. [root@zappa site-packages]# rpm -qf /usr/lib64/python3.7/site-packages/rpm/_rpm.cpython* error: file /usr/lib64/python3.7/site-packages/rpm/_rpm.cpython*: No such file or directory [root@zappa site-packages]# rpm -qf /usr/lib64/python3.7/site-packages/rpm/__init__.py error: file /usr/lib64/python3.7/site-packages/rpm/__init__.py: No such file or directory I wonder how you can get: /usr/lib64/python3.7/site-packages/rpm/__init__.py No such file or directory And at the same time: File "/usr/lib64/python3.7/site-packages/rpm/__init__.py", line 38, in <module> from rpm._rpm import * ModuleNotFoundError: No module named 'rpm._rpm' However python3-dnf-3.0.1-1.fc29.noarch.rpm requires "python(abi) = 3.6" and you have python3-3.7.0-1.fc29.x86_64. look like your deps are in broken state. You need to update to dnf-3.0.2-1.fc29. Use the dnf-2 command to get updates. $ sudo dnf-2 distrosync Does this return anything? $ dnf repoquery --duplicated Sorry that's my bad. I symlinked all the missing modules until I hit that final issue. The real issue is this: [root@zappa site-packages]# yum info Traceback (most recent call last): File "/usr/bin/yum", line 57, in <module> from dnf.cli import main ModuleNotFoundError: No module named 'dnf' And if I change the symlink for python3 to python 3.6 instead of 3.7, I get this instead: Traceback (most recent call last): File "yum", line 57, in <module> from dnf.cli import main File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module> import dnf.base File "/usr/lib/python3.6/site-packages/dnf/base.py", line 32, in <module> from dnf.module.metadata_loader import ModuleMetadataLoader File "/usr/lib/python3.6/site-packages/dnf/module/metadata_loader.py", line 25, in <module> gi.require_version('Modulemd', '1.0') AttributeError: module 'gi' has no attribute 'require_version' Why do you change symlinks? As long as you are changing where /usr/bin/python3 leads to and what directories packages install their files, I'm unable to help you. Well I changed it to test it ... because yum using python3 is broken now. I didn't change the symlink of python3 to python3.7 myself . Something's quite broken here. Nevermind, I fixed the problem by downgrading python3 to 3.6.5 ... remember me to never use "--best --allowerasing" again ever. If dnf --best --allowerasing pulls in python3 3.7.0 without updating dependent packages, that's definitively a bug. Could someone add more details about how to downgrade to python-3.6.5, if thats the best fix you have? I tried downgrading python3 and python3-libs, but there are 40 or so dependent packages that would also need downgrading. Do I have find each and every on in koji and dowgrade without help from dnf? Why do you need to downgrade? What is the issue you get? # dnf update Traceback (most recent call last): File "/usr/bin/dnf", line 57, in <module> from dmf.cli import main ModuleNotFoundError: No module named 'dnf' # rpm -qf /usr/bin/dnf dnf-2.7.5-16.fc29.noarch That's the issue you get when you upgrade to the latest python3 with --best --allowerasing isn't it ? $ rpm -q dnf python3-dnf python3 python3-rpm $ rpm -q --requires python3-dnf | grep python $ rpm -q --requires python3-rpm | grep python John has the issue currently ... I did rollback the python3 version to the previous one. > I did rollback the python3 version to the previous one.
How? Could you please answer my queries?
Oh, sorry, I cannot read. # rpm -q dnf python3-dnf python3 python3-rpm dnf-3.0.3-4.fc29.noarch python3-dnf-3.0.3-4.fc29.noarch python3-3.7.0-3.fc29.x86_64 python3-rpm-4.14.2-0.rc1.1.fc29.2.x86_64 # rpm -q --requires python3-dnf | grep python /usr/bin/python3 python(abi) = 3.7 python3-gobject-base python3-gpg python3-hawkey >= 0.14.0 python3-iniparse python3-libcomps >= 0.1.8 python3-libdnf python3-libdnf >= 0.14.0 python3-librepo >= 1.9.0 python3-rpm >= 4.14.0 python3-smartcols >= 0.3.0 # rpm -q --requires python3-rpm | grep python libpython3.7m.so.1.0()(64bit) python(abi) = 3.7 oops sorry, thats not correct. That was from a working system. The broken system is different .... # rpm -q dnf python3-dnf python3 python3-rpm dnf-2.7.5-16.fc29.noarch python3-dnf-2-7-5-16.fc29.noarch python3-3.6.5-4.fc29.x86_64 python3-3.7.0-3.fc29.x86_64 python3-rpm-4.14.1-10.rc1.1.fc29.2.x86_64 # rpm -q --requires python3-dnf | grep python /usr/bin/python3 python(abi) = 3.6 python3-gobject-base python3-gpg python3-hawkey >= 0.11.1 python3-iniparse python3-libcomps >= 0.1.8 python3-librepo >= 1.8.1 python3-rpm >= 4.14.0 python3-smartcols >= 0.3.0 # rpm -q --requires python3-rpm | grep python libpython3.6m.so.1.0()(64bit) python(abi) = 3.6 You have two python3 packages at the same time. That is not supposed to happen. Have you quit dnf in mid-transaction? python3-3.6.5-4.fc29.x86_64 python3-3.7.0-3.fc29.x86_64 If you have python2-dnf installed you should be able to recover with /usr/bin/dnf-2. If not, you have to use rpm commands. This looks like an issue with the installed RPMs as mentinoned in comment#31. I don't think there's anything to be fixed. *** NEED SUPPORT *** Hi, Im getting similar issue and ive gone through all the above suggested commands and ran in my machine. can someone please go through the below current config in my machine and let me know what went wrong and how I can fix this ? yum / dnf Traceback (most recent call last): File "/usr/bin/yum", line 57, in <module> from dnf.cli import main ModuleNotFoundError: No module named 'dnf' ------------------------------------ python --version Python 3.6.8 ----------------------------------- z whereis python python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.11 /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/bin/python3.6m-x86_64-config /usr/bin/python3.11-config /usr/bin/python3.11-x86_64-config /usr/bin/python /usr/lib/python3.11 /usr/lib64/python3.6 /usr/lib64/python3.11 /usr/local/lib/python3.6 /usr/local/lib/python3.11 /usr/include/python3.6m /usr/include/python3.11 /usr/share/python3.11-wheels /usr/share/man/man1/python.1.gz ---------------------------------- cat /etc/redhat-release Red Hat Enterprise Linux release 8.8 (Ootpa) -------------------------------- rpm -q dnf / rpm -qf /usr/bin/dnf dnf-4.7.0-16.el8_8.noarch ------------------------------- rpm -qf /usr/bin/python3 python3.11-3.11.2-2.el8_8.2.x86_64 python36-3.6.8-38.module+el8.5.0+12207+5c5719bc.x86_64 --------------------------------- head -n2 /usr/bin/dnf #!/usr/libexec/platform-python # The dnf executable script. ----------------------------------- $ rpm -qf /usr/lib64/python3.7/site-packages/rpm/_rpm.cpython error: file /usr/lib64/python3.7/site-packages/rpm/_rpm.cpython: No such file or directory ------------------------------- $ dnf repoquery --duplicated Traceback (most recent call last): File "/usr/bin/dnf", line 57, in <module> from dnf.cli import main ModuleNotFoundError: No module named 'dnf' -------------------------------------------- $ rpm -q --requires python3-dnf | grep python /usr/libexec/platform-python python(abi) = 3.6 python3-gpg python3-hawkey >= 0.63.0-8 python3-libcomps >= 0.1.8 python3-libdnf python3-libdnf >= 0.63.0-8 python3-rpm >= 4.14.2-35 ---------------------------------- $ rpm -q dnf python3-dnf python3 python3-rpm dnf-4.7.0-16.el8_8.noarch python3-dnf-4.7.0-16.el8_8.noarch package python3 is not installed python3-rpm-4.14.3-26.el8.x86_64 ----------------------------------- Thanks in advance. This is a 6 years old closed Fedora bugzilla. If you have a problem on RHEL, please use RHEL's support channels. Thanks Miro, could you provide any link for RHEL support ? (In reply to Miro Hrončok from comment #36) > https://www.redhat.com/en/services/support > https://access.redhat.com/support Thank you. |