Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, you are correct. pip3 is installed by XCode.

I was having trouble understanding the scenario you seem to have in mind because it never occurred to me that someone would try to run Python without doing an install from python.org as I explicitly recommend.

If someone does install a version of Python from python.org, it puts the bin folder for that version first on PATH via this line in .zprofile:

PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:${PATH}"

It also puts a symlink for python3 and pip3 into the `/usr/local/bin` folder that comes ahead of `/usr/bin`.

So if the user runs

`pip3 install ...`

it will not find the version in `/usr/bin` because there will be two other directories ahead of it on the path that have an instance of `pip3`.

As an aside, if they do the improbable and run something like

`/usr/bin/pip3 install ...`

or if they do not have any Python from python.org installed and run

`pip3 install`

what they will end up with is a user-install that puts libraries under their `~/Library` directory because (at least on an Apple Silicon mac) pip can't write to `/usr/bin`. This fallback to a user-install is confusing to people who encounter it, but it is very different from "installing to the system python."

To summarize, it is exceedingly unlikely that a student who is not comfortable running commands from the terminal is going make the mistake you seem to be worried about and end up with libraries in the user-install location:

1. They do not install an official Python even though that is exactly what I recommend.

2. They do install XCode or XCode Command Line tools, then try to use `pip3 install ...`



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: