I bought a book about cyber security in Python, and the author uses python version 3.9. I'll get to dnf in a minute. I use Fedora Linux 37 and the default linux is linux 3.11.
I set up a virtual environment and tried to install the authors "requirements.txt" packages. The process choked, apparently the new version of python can't handle retrograde versions of, say, numpy (and other packages).
So I did something some may well criticize. I downloaded python 3.9 and compiled and installed it. It appeared to go OK. But then I noticed that both "pip" and "dnf" were broken.
Pip gave me the message:
$ pip install --upgrade pip Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to [:<exec_prefix>] Traceback (most recent call last): File "/usr/bin/pip", line 7, in from pip._internal.cli.main import main ModuleNotFoundError: No module named 'pip._internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/bin/pip", line 10, in from pip._internal.main import main ModuleNotFoundError: No module named 'pip._internal' During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/bin/pip", line 17, in from pip._internal import main ModuleNotFoundError: No module named 'pip._internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/bin/pip", line 20, in from pip import main ImportError: cannot import name 'main' from 'pip' (unknown location)
And from dnf:
dnf install wireshark
Traceback (most recent call last): File "/usr/bin/dnf", line 61, in from dnf.cli import main ModuleNotFoundError: No module named 'dnf'
Now, call me naive, but I thought one of the rationales for virtual environments was to be able to use different python versions with a particular program.
As to what happened to my dnf, I have no clue, but I don't know how to fix it.
Thanks in advance for your help.
BryGuy