Pip installs to unexpected place
Mats Wichmann
mats at wichmann.us
Tue Apr 15 21:31:07 EDT 2025
On 4/15/25 16:07, Grant Edwards via Python-list wrote:
> On 2025-04-15, Thomas Passin via Python-list <python-list at python.org> wrote:
>
>> On Linux, at least, it's standard for pip to install into the user's
>> site-packages location if it's not invoked with admin privileges - even
>> without --user. Pip will emit a message saying so. Well, that used to be
>> true but nowadays Pip wants you to use the --break-system-packages flag
>> if you want to insist on installing into the system's Python install,
>> even if it's going to go into --user.
>
> I've always been a little baffled by that message when installing with
> --user. How can that possibly break system stuff?
Your user install dir is in your python path, so when you go to run an
installed Python program which imports other packages, it might pick up
the version you have in your user space rather than the system one it
was tested with. It's about a whole curated Python environment that the
distro spends time validating - a different version picked up elsewhere
*might* be fine. Or it might not. I think they've had enough "it's not"
bug reports to have gotten quite prickly about the subject.
More information about the Python-list
mailing list