There’s the ultimate problem. Never, ever, ever, ever run sudo pip
-anything unless you know exactly what you are doing, as it modifies the system-installed packages in the system-installed Python. Otherwise, you can and often will break not only one specific package or environment, but your entire system Python install, and sometimes even your whole operating system itself (if, say, the package manager relies on that same Python install, as many often do). On newer Linux distros (and pip versions), pip will actively refuse to run against the system-installed Python if the Linux distro marks it as such, unless you deliberately pass the special highly discouraged flag --break-system-packages
.
I can’t narrow it down without seeing the actual output from the install command you ran, but based on that output, likely some compiled code or dependencies got replaced with something not compiled for your platform, i.e. armhf, arm7 or armv8a (aarch64) depending on your version and edition of Raspbian. Therefore, simply uninstalling paramiko might well not solve it.
As a shotgun approach, you could try deleting everything in the /usr/local/lib/python3.9/dist-packages
and then attempting to update pip
. You can also create a new, isolated virtual environment, which you should always use over the system environment, with python3 -m venv .venv
(or whatever you prefer for its name and location other than .venv
), activate it, and install the package you want in that (without using sudo
, of course).
If that still doesn’t work, you could try using your system package manager to re-install the system pip, e.g. sudo apt update && sudo apt remove python3-pip && sudo apt install python3-pip
.
And if that doesn’t work, I’d re-flash the Pi with the latest OS image (which you might want to do from the start, if you don’t have much valuable on it that you can’t easily back up and restore).
The most important thing to remember to prevent this is NEVER EVER EVER USE sudo pip
ANYTHING. Instead, create and activate one of more venvs.
Best of luck!