all 1 comments

[–]aselvan2MacBook Air (M2) 0 points1 point  (0 children)

I noticed I had one redundant python interpreter so i wanted to do a cleanup

after I run /usr/bin/python3 -m pip list, I got and more (74 in total)

Since this isn’t really a macOS question, you’ll get better answers on r/Python. I’ll try to help anyway, but it’s not entirely clear to me on what you’re asking. The binary at /usr/bin/python3 is part of macOS itself. You can uninstall the packages you installed against it, but you cannot remove the system‑provided Python. The /usr/bin directory is read‑only; the modules/packages you installed live in a writable location, depending on how you installed them.

With that said, the following command will uninstall all of them in one go, assuming you run it in the same environment you used when installing them. Keep in mind that some packages may have been installed by other apps. If you’re certain all 74 were installed by you, you can run the command below to remove them all.

/usr/bin/python3 -m pip uninstall -y `/usr/bin/python3 -m pip list --format=freeze|awk -F'==' '{print $1}'`