0

dnf broken after downgrading from python3.11 to python3.10 on Fedora 37 x86_64. It says

  File "/usr/bin/dnf", line 61, in <module>
    from dnf.cli import main
ModuleNotFoundError: No module named 'dnf'

Since I was previously using 3.11 I decided upgrading back to 3.11 would fix it, so I tried installing it from source and compiling it, then I made python3 and python symlinks in /usr/bin point to python3.11, now if I type python3 or python it works, but everything else doesn't. Also things like OpenSSL, though present on the system, are not seen by other tools as compiled. I also tried installing python 3.11 with pyenv, but it failed due to it not finding OpenSSL (but which openssl gives me /usr/bin/openssl).

Аня А.
  • 101
  • 2
  • Each Python release stores installed packages in its own `site-packages` directory, so any packages you've installed for Python 3.11 will need to be reinstalled for python 3.10. The [pyenv-pip-migrate](https://github.com/pyenv/pyenv-pip-migrate) plugin for pyenv should help you out here. – JRiggles May 25 '23 at 14:32
  • @JRiggles , I've been using python3.11 for long time, then I downgraded and found that nothing works, I need to find a way to upgrade back and fix everything (simply installing python3.11 doesn't work, as I wrote) – Аня А. May 25 '23 at 15:02
  • Your question doesn't mention that you are trying to update to Python 3.11 again after downgrading to 3.10 - you may want to [edit] it to clarify that. If you've already uninstalled Python 3.11, you've also uninstalled any packages along with it. – JRiggles May 25 '23 at 15:04
  • Sure. Is it clear now? – Аня А. May 25 '23 at 15:48

0 Answers0