2

I have used pip to install packages many times and all of a sudden it's gone. I can't recall if I used it after a system update or if it's been gone since I updated a few days ago. I'm using fedora 38.

Thanks!

0

1 Answer 1

2

System-wide pip installs are inherently dangerous, see this explanation. (Replace apt with dnf to make this apply 100% for Fedora/CentOS/Alma/Rocky instead of debian/Ubuntu Linux.)

What probably happened is that your Python changed, and since pip installations don't get updated alongside with python, they are now in directories no longer searched by python, and also, if they contained any native functionality, plainly not compatible anymore.

That's why you basically never do system-wide pip installations, but always go for a venv installation that

  1. doesn't have the potential to break your system (that is very real on Fedora, as dnf is a python program and pip will happily overwrite modules it uses) and
  2. can be updated manually (using python3 -m venv --upgrade …)

Even better, whenever possible, you don't use the pip-supplied version of a Python module, but the fedora-supplied one, because these get automatically updated and are inherently compatible with whatever you're currently running.

1
  • Thanks for this, I had no idea.
    – user583182
    Commented Aug 20, 2023 at 20:25

You must log in to answer this question.